public void Delete(BllSharedFile entity) { if (entity == null) { return; } UnitOfWork?.SharedFileRepository?.Delete(entity.ToDalSharedFile()); UnitOfWork?.Commit(); }
/// <summary> /// Mapping <see cref="BllSharedFile"/> entity to <see cref="DalSharedFile"/> entity. /// </summary> public static DalSharedFile ToDalSharedFile(this BllSharedFile sharedFileEntity) { return(new DalSharedFile() { FileId = sharedFileEntity.FileId, OwnerId = sharedFileEntity.OwnerId, RecipientId = sharedFileEntity.RecipientId }); }
public BllSharedFile Get(BllSharedFile entity) { //TODO: Exc?? if (entity == null) { return(null); } var sharedFile = UnitOfWork?.SharedFileRepository?.Get(entity.ToDalSharedFile()); return(sharedFile?.ToBllSharedFileFile()); }
public void CreateSharedFile(int ownerId, int recipientId, int fileId) { var sharedFile = new BllSharedFile() { FileId = fileId, OwnerId = ownerId, RecipientId = recipientId }; FileSharingService.Create(sharedFile); var sharedFileFromDb = FileSharingService.GetAll() .FirstOrDefault( sf => sf.FileId == sharedFile.FileId && sf.RecipientId == recipientId && sf.OwnerId == ownerId); Assert.AreEqual(sharedFileFromDb?.OwnerId, ownerId); }
public void Update(BllSharedFile entity) { throw new NotImplementedException(); }