public async Task <EntityIdWithVersion <Uri, string> > Create(Func <vCard, vCard> entityInitializer) { using (AutomaticStopwatch.StartDebug(s_logger)) { vCard newVcard = new vCard(); var initializedVcard = entityInitializer(newVcard); return(await _cardDavDataAccess.CreateEntity(Serialize (initializedVcard))); } }
public async Task <EntityVersion <WebResourceName, string> > Create(Func <vCard, vCard> entityInitializer) { using (AutomaticStopwatch.StartDebug(s_logger)) { vCard newVcard = new vCard(); newVcard.UniqueId = Guid.NewGuid().ToString(); var initializedVcard = entityInitializer(newVcard); return(await _cardDavDataAccess.CreateEntity(Serialize (initializedVcard), newVcard.UniqueId)); } }
public async Task <EntityVersion <WebResourceName, string> > Create(Func <TEntity, Task <TEntity> > entityInitializer, TContext context) { using (AutomaticStopwatch.StartDebug(s_logger)) { TEntity newEntity = new TEntity(); var uid = Guid.NewGuid().ToString(); SetUid(newEntity, uid); var initializedVcard = await entityInitializer(newEntity); return(await _cardDavDataAccess.CreateEntity(Serialize(initializedVcard), uid)); } }