protected bool Deactivate(IMovieWriter entity) { // Deactivate it MovieWritersRepository.Deactivate(entity); // Try to Save Changes MovieWritersRepository.SaveChanges(); // Finished! return(true); }
public virtual bool AreEqual(IMovieWriterModel model, IMovieWriter entity) { return EntityMapper.AreEqual(model, entity) // MovieWriter Properties // <None> // Related Objects && model.MovieId == entity.MovieId && model.WriterId == entity.WriterId ; }
public virtual bool AreEqual(IMovieWriterModel model, IMovieWriter entity) { return(EntityMapper.AreEqual(model, entity) // MovieWriter Properties // <None> // Related Objects && model.MovieId == entity.MovieId && model.WriterId == entity.WriterId ); }
public virtual IMovieWriterModel MapToModelListing(IMovieWriter entity, int currentDepth = 1) { currentDepth++; var model = EntityMapper.MapToModelListing <IMovieWriter, MovieWriterModel>(entity); // MovieWriter Properties // <None> // Related Objects model.MovieId = entity.MovieId; model.WriterId = entity.WriterId; // Return Entity return(model); }
protected bool Remove(IMovieWriter entity) { if (entity == null) { return(true); } // No entity found to remove, consider it passed // Remove it MovieWritersRepository.Remove(entity); // Try to Save Changes MovieWritersRepository.SaveChanges(); // Finished! return(true); }
public virtual void MapToEntity(IMovieWriterModel model, ref IMovieWriter entity, int currentDepth = 1) { currentDepth++; // Assign Base properties EntityMapper.MapToEntity(model, ref entity); // MovieWriter Properties // <None> // Related Objects entity.MovieId = model.MovieId; entity.Movie = (Movie)model.Movie?.MapToEntity(); entity.WriterId = model.WriterId; entity.Writer = (Person)model.Writer?.MapToEntity(); // Associated Objects // <None> }
public virtual IMovieWriterModel MapToModel(IMovieWriter entity, int currentDepth = 1) { currentDepth++; var model = EntityMapper.MapToModel<IMovieWriter, MovieWriterModel>(entity); // MovieWriter Properties // <None> // Related Objects model.MovieId = entity.MovieId; model.Movie = entity.Movie?.MapToModel(); model.WriterId = entity.WriterId; model.Writer = entity.Writer?.MapToModel(); // Associated Objects // <None> // Return Entity return model; }
public void Remove(IMovieWriter entity) { Context.MovieWriters.Remove((MovieWriter)entity); }
public void Add(IMovieWriter entity) { Context.MovieWriters.Add((MovieWriter)entity); }
public static bool AreEqual(this IMovieWriterModel model, IMovieWriter entity) { return(Mapper.AreEqual(model, entity)); }
public static IMovieWriterModel MapToModelListing(this IMovieWriter entity, int currentDepth = 1) { return(Mapper.MapToModelListing(entity, currentDepth)); }
public static void MapToEntity(this IMovieWriterModel model, ref IMovieWriter entity, int currentDepth = 1) { Mapper.MapToEntity(model, ref entity, currentDepth); }
protected bool Deactivate(IMovieWriter entity) { // Deactivate it MovieWritersRepository.Deactivate(entity); // Try to Save Changes MovieWritersRepository.SaveChanges(); // Finished! return true; }
public void Deactivate(IMovieWriter entity) { entity.Active = false; Update(entity); }
public void Update(IMovieWriter entity) { Context.SetModified(entity); }
protected bool Remove(IMovieWriter entity) { if (entity == null) { return true; } // No entity found to remove, consider it passed // Remove it MovieWritersRepository.Remove(entity); // Try to Save Changes MovieWritersRepository.SaveChanges(); // Finished! return true; }
public static bool AreEqual(this IMovieWriterModel model, IMovieWriter entity) { return Mapper.AreEqual(model, entity); }