public static AuthorBusiness ConvertToBusinessEntity(Author author) { var businessObject = new AuthorBusiness(); businessObject.Id = author.Id; businessObject.Name = author.Name; businessObject.Gender = author.Gender; if (author.Birthdate != null) { businessObject.Birthdate = (DateTime)author.Birthdate; } businessObject.isDeleted = author.isDeleted; return(businessObject); }
public static Author ConvertToWebEntity(AuthorBusiness author) { var dataObject = new Author(); dataObject.Id = author.Id; dataObject.Name = author.Name; dataObject.Gender = author.Gender; if (author.Birthdate != null) { dataObject.Birthdate = (DateTime)author.Birthdate; } dataObject.isDeleted = author.isDeleted; return(dataObject); }
public AuthorsController(BookStoreContext context) { _authorBusiness = new AuthorBusiness(context); }