Base solution for your next web application

Activities of "vitaly"

WebLogAppService / DownloadWebLogs

ICSharpCode.SharpZipLib.Zip.ZipException: size was 1670059, but I expected 1669650 at ICSharpCode.SharpZipLib.Zip.ZipOutputStream.CloseEntry() at ICSharpCode.SharpZipLib.Zip.ZipOutputStream.Finish() at ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.Close() at System.IO.Stream.Dispose() at omni.Logging.WebLogAppService.DownloadWebLogs() at Castle.Proxies.WebLogAppServiceProxy.DownloadWebLogs_callback() at Castle.Proxies.Invocations.IWebLogAppService_DownloadWebLogs.InvokeMethodOnTarget() at Castle.DynamicProxy.AbstractInvocation.Proceed() at Abp.Authorization.AuthorizationInterceptor.Intercept(IInvocation invocation) at Castle.DynamicProxy.AbstractInvocation.Proceed() at Abp.Domain.Uow.UnitOfWorkInterceptor.PerformSyncUow(IInvocation invocation, UnitOfWorkOptions options) at Abp.Domain.Uow.UnitOfWorkInterceptor.PerformUow(IInvocation invocation, UnitOfWorkOptions options) at Abp.Domain.Uow.UnitOfWorkInterceptor.Intercept(IInvocation invocation) at Castle.DynamicProxy.AbstractInvocation.Proceed() at Abp.Auditing.AuditingInterceptor.PerformSyncAuditing(IInvocation invocation, AuditInfo auditInfo) at Abp.Auditing.AuditingInterceptor.Intercept(IInvocation invocation) at Castle.DynamicProxy.AbstractInvocation.Proceed() at Abp.Runtime.Validation.Interception.ValidationInterceptor.Intercept(IInvocation invocation) at Castle.DynamicProxy.AbstractInvocation.Proceed() at Castle.Proxies.WebLogAppServiceProxy.DownloadWebLogs()

When large object [more than nvarchar(1024)] is pushed as parameter value to AbpAuditLogs it will be trancated.

Example: {"input":{"bla":{"bla bla":null,"bla bla bla":null,<span style="color:#FF0000">...</span>

If we will try to display Audit logs then vm.getFormattedParameters will fail as Unexpected token . in JSON at position 1021, because the object was trancated and is not valid anymore.

Question: how could that be fixed for production? Can we move Audit Logs to NoSQL db for example?

Hi Halil,

How to change behavior - if user authorzied - don't show front end page and redirect to application right away?

Question

Hi Halil,

Please advise the proper approach to change front-end theme from Metronic Corporate to Meronic Onepage.

Regards

Question

Hello, could you help to analyze the issue?

I have the following Task in AppService:

public async Task<StoreDto> CreateOrUpdateStore(CreateOrUpdateStoreInput input)
        {
            if (input.Store.Id.HasValue)
            {
                var store = await _storeRepository.GetAsync(input.Store.Id.Value);
                input.Store.MapTo(store);
                await _storeRepository.UpdateAsync(store);
                return store.MapTo<StoreDto>();
            }
            else
            {
                var store = input.Store.MapTo<Store>();
                await _storeRepository.InsertAsync(store);
                return store.MapTo<StoreDto>();
            }
        }

StoreDto:

[AutoMap(typeof(Store))]
    public class StoreDto
    {
        public int? Id { get; set; }
        ...
        
        //Schedules
        public Collection<StoreScheduleDto> StoreSchedules { get; set; }
    }

StoreScheduleDto:

[AutoMap(typeof(StoreSchedule))]
    public class StoreScheduleDto
    {
        public int? Id { get; set; }
        public int DayOfWeek { get; set; }                  // 0-Every day 1-Mo, 2-Tu, 3-We, 4-Th, 5-Fr, 6-Sa, 7-Su
        public bool Active { get; set; }
        public string StartTime { get; set; }
        public string FinishTime { get; set; }
    }

When I create new Store with collection of StoreSchedules it's working good. But when I try to update existing item, sending to AppService input:

"input": {
        "store": {
            "id": 7,
            "storeGroupId": 1,
            "name": "asdfdf",
            "storeSchedules": [
                {
                    "id": 25,
                    "dayOfWeek": 0,
                    "active": false,
                    "startTime": "09:00",
                    "finishTime": "20:00"
                },
                {
                    "id": 26,
                    "dayOfWeek": 1,
                    "active": true,
                    "startTime": "03:30",
                    "finishTime": "23:30"
                },
               ...

it throw the following error:

System.InvalidOperationException: The operation failed: The relationship could not be changed because one or more of the foreign-key properties is non-nullable. When a change is made to a relationship, the related foreign-key property is set to a null value. If the foreign-key does not support null values, a new relationship must be defined, the foreign-key property must be assigned another non-null value, or the unrelated object must be deleted. at System.Data.Entity.Core.Objects.ObjectContext.PrepareToSaveChanges(SaveOptions options) at System.Data.Entity.Core.Objects.ObjectContext.<SaveChangesInternalAsync>d__31.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult() at Abp.EntityFramework.AbpDbContext.<SaveChangesAsync>d__34.MoveNext() in D:\Halil\GitHub\aspnetboilerplate\src\Abp.EntityFramework\EntityFramework\AbpDbContext.cs:line 196 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult() at Abp.EntityFramework.Uow.EfUnitOfWork.<SaveChangesInDbContextAsync>d__22.MoveNext() in D:\Halil\GitHub\aspnetboilerplate\src\Abp.EntityFramework\EntityFramework\Uow\EfUnitOfWork.cs:line 198 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.GetResult() at...

Question

Hi,

I would like to repeat same element in html like below. But @L doesn't work properly. The result on the screen is [__Day_0], [__Day_1], etc. I have translation for these words in xml. I guess miss something. How to write it properly?

<div ng-repeat="i in [0,1,2,3,4,5,6,7]" class="row">
                    <div class="col-sm-4">
                        <div class="md-checkbox-list">
                            <div class="md-checkbox">
                                <input id="{{'day_'+i}}" class="md-check" type="checkbox" name="{{'day_'+i}}">
                                <label for="{{'day_'+i}}">
                                    <span class="inc"></span>
                                    <span class="check"></span>
                                    <span class="box"></span>
                                    @L("{{'__Day_'+i}}")
                                </label>
                            </div>
                        </div>
                    </div>

                    <div class="col-sm-8">
                        <input type="text" id="{{'range_'+i}}" value="" name="range" />
                    </div>
                </div>

Hello,

I have problem with integrating ion.RangeSlider plugin in my SPA:

  1. Added to ScriptPaths.cs public const string Ion_RangeSlider = "~/libs/ion-rangeslider/js/ion.rangeSlider.js";

  2. Added to StylePaths.cs public const string Ion_RangeSlider = "~/libs/ion-rangeslider/css/ion.rangeSlider.Metronic.css"; public const string Ion_RangeSlider_Nice = "~/libs/ion-rangeslider/css/ion.rangeSlider.skinNice. public const string Ion_RangeSlider_Norm = "~/libs/ion-rangeslider/css/normalize.css";

  3. Added to AppBundleConfig.cs ScriptPaths.Ion_RangeSlider -> ScriptBundle .Include(StylePaths.Ion_RangeSlider_Norm)->StyleBundle .Include(StylePaths.Ion_RangeSlider)->StyleBundle .Include(StylePaths.Ion_RangeSlider_Nice)->StyleBundle

  4. Added in createOrEditModl.js function ($scope, $uibModalInstance, storeService, storeGroupService, storeId) { var vm = this; var range = $("#range_id"); ... function init() { vm.getStoreForEdit(); vm.getStoreGroups();

             range.ionRangeSlider({});
    
  5. Added in createOrEditModal.cshtml <input type="text" id="range_id" value="" name="range" />

As a result - it doesn't work. On the form I have standard imput field. Please help me)

Question

**I have 2 questions related to database migration: 1 - I create entities and declare that ID should be called like EntityID, but when the migration script is generated there are two fileds the ID and the EntityID in target Table. See script below, marked in red. Question: why and how to get rid of ID filed?

2 - Two entities are related, I want the relation field to be called the same way in both tables, like EntityID. But when the migration script is generated the field is called Entity_EntityId. See script below, marked green. Question: how and where to override this convention.**

ENTITY #1 [Table("OmniCategories")] public class Category : FullAuditedEntity, IMustHaveTenant { public Category() { Items = new HashSet<Item>(); }

    public virtual int TenantId { get; set; }              

    [Key]
    public virtual int CategoryId { get; set; }             

    public virtual int? ParentCategoryId { get; set; }     

    [ForeignKey("ParentCategoryId")]
    public virtual Category Parent { get; set; }            

    public virtual ICollection&lt;Item&gt; Items { get; set; }    
}

ENTITY #2 [Table("OmniItems")] public class Item : FullAuditedEntity, IMustHaveTenant { public virtual int TenantId { get; set; }

    [Key]
    public virtual int ItemId { get; set; }

    public virtual int? ParentItemId { get; set; }

	[Required]
    [Column("CategoryId")]
    public virtual Category Category { get; set; }

    [ForeignKey("ParentItemId")]
    public virtual Item Parent { get; set; }

}

MIGRATION CreateTable( "dbo.OmniItems", c => new { ItemId = c.Int(nullable: false, identity: true), TenantId = c.Int(nullable: false), ParentItemId = c.Int(), IsDeleted = c.Boolean(nullable: false), DeleterUserId = c.Long(), DeletionTime = c.DateTime(), LastModificationTime = c.DateTime(), LastModifierUserId = c.Long(), CreationTime = c.DateTime(nullable: false), CreatorUserId = c.Long(), <span style="color:#FF0000"> Id = c.Int(nullable: false),</span> Category_CategoryId = c.Int(nullable: false),

                },
            annotations: new Dictionary&lt;string, object&gt;
            {
                { "DynamicFilter_Item_MustHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
                { "DynamicFilter_Item_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
            })
            .PrimaryKey(t => t.ItemId)
            .ForeignKey("dbo.OmniCategories", t => t.&lt;span style=&quot;color:#00BF00&quot;&gt;Category_CategoryId&lt;/span&gt;, cascadeDelete: true)
            .ForeignKey("dbo.OmniItems", t => t.ParentItemId)
            .Index(t => t.ParentItemId)
            .Index(t => t.Category_CategoryId);

Can I use for User authorization only email, no UserName?

Sorry for asking, couldn't find where I can write code to fill default data in some tables for tenant when new tenant is creating. Pls help.

Showing 1 to 10 of 10 entries