public override void Initialize() { base.Initialize(); base.Container.RegisterType <IPlayerService, PlayerService>(); var unitOfWork = base.Container.Resolve <IUnitOfWorkAsync>(); var player = new Player { Id = 1, Name = "test-name", Email = "test-email", Birth = DateTime.Parse("2017-5-29"), Sex = 0, Account = new Account { Id = 1, Login = "******", Password = "******", ObjectState = ObjectState.Added }, ObjectState = ObjectState.Added }; unitOfWork.Repository <Player>().Insert(player); unitOfWork.SaveChanges(); //unitOfWork.Repository<Account>().Insert(new Account //{ // playerId = 1, // CreatedAt = DateTime.Now, // Login = "******", // Password = "******".Md5Encrypt(), // ObjectState = ObjectState.Added, // player = player //}); //unitOfWork.SaveChanges(); provider = (ILocalizedProvider)this.Container.Resolve(typeof(ILocalizedProvider)); this._service = base.Container.Resolve <IPlayerService>(); }
public override void Initialize() { base.Initialize(); base.Container.RegisterType <IGameService, GameService>(); var unitOfWork = base.Container.Resolve <IUnitOfWorkAsync>(); //var game = new Game //{ // ObjectState = ObjectState.Added //}; //unitOfWork.Repository<Game>().Insert(game); //unitOfWork.SaveChanges(); unitOfWork.Repository <Account>().Insert(new Account { Id = 2, Login = "******", Password = "******".Md5Encrypt(), ObjectState = ObjectState.Added, Player = new Player { Id = 2, Sex = Sex.Male, Name = "test", Birth = DateTime.Now, Email = "email", ObjectState = ObjectState.Added } }); unitOfWork.SaveChanges(); provider = (ILocalizedProvider)this.Container.Resolve(typeof(ILocalizedProvider)); this._service = base.Container.Resolve <IGameService>(); }