示例#1
0
        public async Task <IHttpActionResult> Read(int sampleId)
        {
            var result = await SamplesDao.Read(this, sampleId);

            if (result == null)
            {
                return(NotFound());
            }

            return(JsonWithPermissions(result));
        }
示例#2
0
        public async Task <IHttpActionResult> Update(int sampleId, SamplesEditViewModel model)
        {
            var sample = await SamplesDao.Read(this, sampleId);

            if (sample == null)
            {
                return(NotFound());
            }

            var result = await SamplesDao.Update(this, sample, model);

            return(JsonWithPermissions(result));
        }