Base solution for your next web application

Activities of "vitaly"

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.

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

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);
Answer

Ok, i fixed point 2 by myself. But point 1 I can't fix.

Is this the same in case (a) Tenant is created manually from Host (b) Tenant is created by user from landing page?

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)

Could you help me?

Thank you! It helped.

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>

Thank you )

Showing 1 to 10 of 21 entries