public async Task <JsonResult> Save(TypeOfAccumulatedDTO data)
        {
            var accumulatedType = new AccumulatedType()
            {
                Name = data.Name,
                TypeOfAccumulated = (TypeOfAccumulated)data.TypeOfAccumulated,

                //Common
                Active       = true,
                company      = SessionModel.CompanyID,
                InstanceID   = SessionModel.InstanceID,
                CreationDate = DateTime.Now,
                StatusID     = 1,
                user         = SessionModel.IdentityID,
                Timestamp    = DateTime.Now,
            };

            if (!data.ID.HasValue)
            {
                accumulatedType.ID = Guid.NewGuid();
                await client.CreateAsync(new List <AccumulatedType> {
                    accumulatedType
                }, SessionModel.IdentityID);
            }
            else
            {
                accumulatedType.ID = data.ID.Value;
                await client.UpdateAsync(new List <AccumulatedType> {
                    accumulatedType
                }, SessionModel.IdentityID);
            }

            return(Json(accumulatedType.ID));
        }
 /// <summary>
 /// Converts the <see cref="sourceValue" /> parameter to the <see cref="destinationType" /> parameter using <see cref="formatProvider"
 /// /> and <see cref="ignoreCase" />
 /// </summary>
 /// <param name="sourceValue">the <see cref="System.Object"/> to convert from</param>
 /// <param name="destinationType">the <see cref="System.Type" /> to convert to</param>
 /// <param name="formatProvider">not used by this TypeConverter.</param>
 /// <param name="ignoreCase">when set to <c>true</c>, will ignore the case when converting.</param>
 /// <returns>
 /// an instance of <see cref="AccumulatedType" />, or <c>null</c> if there is no suitable conversion.
 /// </returns>
 public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => AccumulatedType.CreateFrom(sourceValue);