Exemplo n.º 1
0
 public int? CreateUser(CreatedUserDto userDto)
 {
     return UnitOfWork.Do(uow =>
     {
         var found = uow.Repo<User>().AsQueryable().FirstOrDefault(t => t.Name == userDto.Email);
         if (found == null)
         {
             var user = new User { Name = userDto.Name, Email = userDto.Email };
             return (int)uow.Repo<User>().Insert<decimal>(user);
         }
         return (int?)null;
     });
 }
Exemplo n.º 2
0
 public static PostDto ApplyAuthorName(this PostDto post, User author)
 {
     post.AuthorName = author.Name;
        return post;
 }