public void CreateAuthor(AuthorBusinessModel author) { var mapper = new AuthorMapper(); var authorNew = mapper.Map(author); this.uow.Authors.Add(authorNew); this.uow.Commit(); author.Id = authorNew.Id;// updates the author.Id to Id value from DB }
public AuthorMapperTests() { Fixture fixture = new Fixture { RepeatCount = 1 }; fixture.Behaviors.Remove(new ThrowingRecursionBehavior()); fixture.Behaviors.Add(new OmitOnRecursionBehavior()); fixture.Customizations.Add(new TypeRelay(typeof(Item), typeof(Book))); fixture.Customizations.Add(new TypeRelay(typeof(ItemBusinessModel), typeof(BookBusinessModel))); this.author = fixture.Create<Author>(); this.authorModel = fixture.Create<AuthorBusinessModel>(); this.mapper = new AuthorMapper(); }
public void UpdateAuthor(AuthorBusinessModel author) { var mapper = new AuthorMapper(); this.uow.Authors.Update(mapper.Map(author)); this.uow.Commit(); }
public void RemoveAuthor(AuthorBusinessModel author) { this.authorFacade.RemoveAuthorById(author.Id); }
public void CreateAuthor(AuthorBusinessModel author) { this.authorFacade.CreateAuthor(author); }
public void UpdateAuthor(AuthorBusinessModel author) { this.authorFacade.UpdateAuthor(author); }