public async Task <string> CreateFileDeal(string cid) { using (var scope = GlobalServices.Container.BeginLifetimeScope()) { var repository = scope.Resolve <ICloudSpeedRepository>(); var entity = new FileDeal() { Cid = cid }; await repository.CreateFileDeal(entity); await repository.Commit(); return(entity.Id); } }
public async Task CreateFileDeal(FileDeal entity) { await DbContext.FileDeals.AddAsync(entity); }