public async Task <bool> Update(DirectionDto directionDto) { DataAccess.Models.Direction value = Mapper.Map <DataAccess.Models.Direction>(directionDto); try { db.Entry(value).State = EntityState.Modified; await db.SaveChangesAsync(); return(true); } catch { return(false); } }
public async Task <bool> Delete(DirectionDto directionDto) { try { DataAccess.Models.Direction value = Mapper.Map <DataAccess.Models.Direction>(directionDto); value.DeletedDateTime = DateTime.Now; value.IsDeleted = true; db.Entry(value).State = EntityState.Modified; await db.SaveChangesAsync(); return(true); } catch { return(false); } }