Пример #1
0
        public async Task Store(Contracts.Entities.User user)
        {
            // search und update User

            int id = user.UserID;

            var UserInDb = await Context.Users.
                           Where(m => m.UserID == id).
                           FirstOrDefaultAsync();

            if (UserInDb == default(Contracts.Entities.User))
            {
                // add new

                Uow.MarkNew(user);
            }
            else
            {
                // syn with existing

                Uow.SetValue(UserInDb, user);

                // search und update Usercommands (add and delete)
            }
        }
Пример #2
0
 public async Task Delete(Contracts.Entities.User user)
 {
     Uow.MarkDeleted(user);
     await Task.FromResult(0);
 }