开发者

Windsor and asp.net MVC singleton race conditions

Quick question regarding the use of Singleton lifestyle in Windsor, and Asp.Net MVC. If the following class is registered as a singleton am I correct in thinking that I will have a race condition?

public class UserMapper : IMap
{
    public void Map(MyDto dto, MyD开发者_Go百科omain domain)
    {
      domain.Username = dto.Username;
      domain.Firstname = dto.Firstname;
      domain.Surname = dto.Surname;
      domain.Password = dto.Password;
    }
}


Your UserMapper does not have any data in it - everything in the Map method relies on parameters given to it, making the method reentrant and thus safe to use as a singleton.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜