예제 #1
0
        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); }
        }
예제 #2
0
        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);
            }
        }