public async Task <Protocols.Response.Source> Create(Protocols.Request.Source source) { var created = await Create(source.Data); return(new Protocols.Response.Source { ResultCode = Code.ResultCode.Success, Data = created?.ToProtocol() }); }
public async Task <Protocols.Response.Source> Update(string id, Protocols.Request.Source source) { var update = source.Data.ToModel(); var updated = await _mongoDbSource.UpdateAsync(id, update); return(new Protocols.Response.Source { ResultCode = Code.ResultCode.Success, Data = (updated ?? update).ToProtocol() }); }
public async Task <Protocols.Response.Source> Update(string id, [FromBody] Protocols.Request.Source source) { return(await _sourceService.Update(id, source)); }
public async Task <Protocols.Response.Source> Create([FromBody] Protocols.Request.Source source) { return(await _sourceService.Create(source)); }