public bool Update(UpdatePicture item) { using (Context context = new Context()) { EfPictureRepository rep = new EfPictureRepository(context); PictureConvert convert = new PictureConvert(context); return(rep.Update(convert.ToEntity(item))); } }
public List <ReadPicture> GetAll() { using (Context context = new Context()) { EfPictureRepository rep = new EfPictureRepository(context); PictureConvert convert = new PictureConvert(context); return(convert.ToReadList(rep.GetAll())); } }
public ReadPicture Remove(int id) { using (Context context = new Context()) { EfPictureRepository rep = new EfPictureRepository(context); PictureConvert convert = new PictureConvert(context); return(convert.ToRead(rep.Remove(id))); } }
public ReadPicture Add(CreatePicture item) { using (Context context = new Context()) { EfPictureRepository rep = new EfPictureRepository(context); PictureConvert convert = new PictureConvert(context); return(convert.ToRead(rep.Add(convert.ToEntity(item)))); } }