public async Task <IActionResult> CreateInventoryTransactionTypeAsync([FromBody] InventoryTransactionTypeViewModel value)
        {
            var response = new SingleModelResponse <InventoryTransactionTypeViewModel>() as ISingleModelResponse <InventoryTransactionTypeViewModel>;

            try
            {
                var entity = await Task.Run(() =>
                {
                    return(_RESTfulAPI_Repository.AddInventoryTransactionType(value.ToEntity()));
                });

                if (response.DidError == false)
                {
                    response.Model = entity.ToViewModel();
                }
            }
            catch (Exception ex)
            {
                string webRoot   = _hostingEnvironment.WebRootPath;
                string errorGuid = String.Format(Guid.NewGuid().ToString().Replace("-", string.Empty).Substring(0, 16));

                HttpContext.Session.SetString("ErrorGuid", errorGuid);
                ViewBag.ErrorGuid = HttpContext.Session.GetString("ErrorGuid");

                if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
                {
                    using (StreamWriter w = new StreamWriter(webRoot + "\\log.txt", append: true))
                    {
                        Log.Logging(ex.ToString(), w, ViewBag.ErrorGuid);
                    }
                }

                if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
                {
                    using (StreamWriter w = new StreamWriter(webRoot + "/log.txt", append: true))
                    {
                        Log.Logging(ex.ToString(), w, ViewBag.ErrorGuid);
                    }
                }


                response.DidError = true;
                //response.ErrorMessage = ex.ToString();


                return(this.Json(new { timestamp = DateTime.Now, errorGuid = ViewBag.ErrorGuid, status = HttpStatusCode.InternalServerError, info = "Error logged in log file." }));
            }

            response.Info = "Client " + " " + HttpContext.Connection.RemoteIpAddress.ToString();

            return(response.ToHttpResponse());
        }
        public async Task <IActionResult> UpdateInventoryTransactionTypeAsync(Int32 id, [FromBody] InventoryTransactionTypeViewModel value)
        {
            var response = new SingleModelResponse <InventoryTransactionTypeViewModel>() as ISingleModelResponse <InventoryTransactionTypeViewModel>;

            try
            {
                var entity = await Task.Run(() =>
                {
                    return(_RESTfulAPI_Repository.UpdateInventoryTransactionType(id, value.ToEntity()));
                });



                response.Model = entity.ToViewModel();
                response.Info  = "The record was updated successfully";
            }
            catch (Exception ex)
            {
                response.DidError     = true;
                response.ErrorMessage = ex.Message;
            }

            return(response.ToHttpResponse());
        }