Base solution for your next web application

Activities of "kalidarscope"

My DTO:

using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text;

namespace Project.Sections.Dto
{
    public class CreateSectionInput
    {
        [MaxLength(SectionsConsts.MaxEntryIdLength)]
        public long EntryId { get; set; }

        [MaxLength(SectionsConsts.MaxRecIdLength)]
        public string REC_ID { get; set; }

        [MaxLength(SectionsConsts.MaxSectionTextLength)]
        public string SECTION_TEXT { get; set; }

        [MaxLength(SectionsConsts.MaxDisplayOrdrLength)]
        public long DISPLAY_ORDER { get; set; }

        [MaxLength(SectionsConsts.MaxAttributeNameLength)]
        public string ATTRIBUTE_NAME { get; set; }

        [MaxLength(SectionsConsts.MaxDefaultBannerColorLength)]
        public string DEFAULT_BANNER_COLOR { get; set; }

        [MaxLength(SectionsConsts.MaxErrorBannerColorLength)]
        public string ERROR_BANNER_COLOR { get; set; }

        [MaxLength(SectionsConsts.MaxWarningBannerColorLength)]
        public string WARNING_BANNER_COLOR { get; set; }

        [MaxLength(SectionsConsts.MaxParentSectionRecIdLength)]
        public string PARENT_SECTION_RECORD_ID { get; set; }

        [MaxLength(SectionsConsts.MaxParentSectionTextLength)]
        public string PARENT_SECTION_TEXT { get; set; }

        [MaxLength(SectionsConsts.MaxTabRecordIdLength)]
        public string TAB_RECORD_ID { get; set; }

        [MaxLength(SectionsConsts.MaxTabTextLength)]
        public string TAB_TEXT { get; set; }

        [MaxLength(SectionsConsts.MaxPrimaryObjectRecordIdLength)]
        public string PRIMARY_OBJECT_RECORD_ID { get; set; }

        [MaxLength(SectionsConsts.MaxPrimaryObjectNameLength)]
        public string PRIMARY_OBJECT_NAME { get; set; } 
        
    }
}

Got this error in log file.

ERROR 2019-02-04 15:26:41,342 [8    ] Mvc.ExceptionHandling.AbpExceptionFilter - The field of type System.Int64 must be a string, array or ICollection type.
System.InvalidCastException: The field of type System.Int64 must be a string, array or ICollection type.
   at System.ComponentModel.DataAnnotations.MaxLengthAttribute.IsValid(Object value)
   at System.ComponentModel.DataAnnotations.ValidationAttribute.IsValid(Object value, ValidationContext validationContext)
   at System.ComponentModel.DataAnnotations.ValidationAttribute.GetValidationResult(Object value, ValidationContext validationContext)
   at Microsoft.AspNetCore.Mvc.DataAnnotations.Internal.DataAnnotationsModelValidator.Validate(ModelValidationContext validationContext)
   at Microsoft.AspNetCore.Mvc.ModelBinding.Validation.ValidationVisitor.ValidateNode()
   at Microsoft.AspNetCore.Mvc.ModelBinding.Validation.ValidationVisitor.Visit(ModelMetadata metadata, String key, Object model)
   at Microsoft.AspNetCore.Mvc.ModelBinding.Validation.ValidationVisitor.VisitChildren(IValidationStrategy strategy)
   at Microsoft.AspNetCore.Mvc.ModelBinding.Validation.ValidationVisitor.VisitComplexType(IValidationStrategy defaultStrategy)
   at Microsoft.AspNetCore.Mvc.ModelBinding.Validation.ValidationVisitor.Visit(ModelMetadata metadata, String key, Object model)
   at Microsoft.AspNetCore.Mvc.ModelBinding.ObjectModelValidator.Validate(ActionContext actionContext, ValidationStateDictionary validationState, String prefix, Object model, ModelMetadata metadata)
   at Microsoft.AspNetCore.Mvc.ModelBinding.ParameterBinder.EnforceBindRequiredAndValidate(ObjectModelValidator baseObjectValidator, ActionContext actionContext, ParameterDescriptor parameter, ModelMetadata metadata, ModelBindingContext modelBindingContext, ModelBindingResult modelBindingResult)
   at Microsoft.AspNetCore.Mvc.ModelBinding.ParameterBinder.BindModelAsync(ActionContext actionContext, IModelBinder modelBinder, IValueProvider valueProvider, ParameterDescriptor parameter, ModelMetadata metadata, Object value)
   at Microsoft.AspNetCore.Mvc.Internal.ControllerBinderDelegateProvider.<>c__DisplayClass0_0.<<CreateBinderDelegate>g__Bind|0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeInnerFilterAsync()
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextExceptionFilterAsync()

As per document(https://docs.aspnetzero.com/documents/zero/latest/Developing-Step-By-Step-Angular#creating-a-modal), i have created the modal to create a new section. When i click the save button, i am getting error like "An internal error occurred during your request".

Got the below info in browser console:

POST http://localhost:22742/api/services/app/Sections/CreateSection 500 (Internal Server Error)
abp.js:342 

ERROR: 

abp.js:342 {code: 0, message: "An internal error occurred during your request!", details: null, validationErrors: null}
service-proxies.ts:743 500

Sorry it was my mistake. Thank you so much @aaron.

Sorry, I have used insert query to insert a record in table. While i was inserting, i have marked the IsDeleted = True.

As you mentioned before i have used using (_unitOfWorkManager.Current.DisableFilter(AbpDataFilters.SoftDelete)). Then i got the records.

After that i have updated the IsDeleted = False and removed the using (_unitOfWorkManager.Current.DisableFilter(AbpDataFilters.SoftDelete)). But didn't get the data.

But i have followed steps mentioned in the document 'https://docs.aspnetzero.com/documents/zero/latest/Developing-Step-By-Step-Angular'. They get the result properly then why i couldn't get it?

IsDeleted = 1 in my database.

I didn't have a TenantId column in my table. Is it must to have?

I am getting above details in the records.

I am getting 1 in AbpSession.TenantId.

Showing 91 to 100 of 108 entries