Example #1
0
        public async Task<IHttpActionResult> GetCalvesByCow(string CowID)
        {
            var calfService = new CalfDataService();
            var processingResult = await calfService.getCalvesByCow(LoggedInUser.ClientID, CowID);
            if (!processingResult.IsSuccessful)
            {
                processingResult.Error = new ProcessingError("An error occurred while getting all available Calves.", "Could not retrieve Calves, please try again. If the problem persists contact support.", true);
                return Ok(processingResult);
            }

            processingResult.Data = processingResult.Data.OrderBy(c => c.TagNumber).ToList();
            return Ok(processingResult);
        }