Esempio n. 1
0
        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()
            });
        }
Esempio n. 2
0
        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()
            });
        }
Esempio n. 3
0
 public async Task <Protocols.Response.Source> Update(string id, [FromBody] Protocols.Request.Source source)
 {
     return(await _sourceService.Update(id, source));
 }
Esempio n. 4
0
 public async Task <Protocols.Response.Source> Create([FromBody] Protocols.Request.Source source)
 {
     return(await _sourceService.Create(source));
 }