{"id":28961638,"url":"https://github.com/alirezakhosravi/nopframework","last_synced_at":"2025-06-24T02:04:37.210Z","repository":{"id":49091009,"uuid":"143864517","full_name":"alirezakhosravi/NopFramework","owner":"alirezakhosravi","description":"Free open-source ASP.net Core development framework derived from NopCommerce","archived":false,"fork":false,"pushed_at":"2022-12-08T15:38:09.000Z","size":35570,"stargazers_count":20,"open_issues_count":6,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2023-02-26T11:36:35.411Z","etag":null,"topics":["boilerplate","dotnet-core","dotnetcore","framework","nopcommerce","nopframework"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alirezakhosravi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-08-07T11:36:26.000Z","updated_at":"2022-09-25T14:15:59.000Z","dependencies_parsed_at":"2023-01-25T16:31:13.535Z","dependency_job_id":null,"html_url":"https://github.com/alirezakhosravi/NopFramework","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"purl":"pkg:github/alirezakhosravi/NopFramework","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alirezakhosravi%2FNopFramework","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alirezakhosravi%2FNopFramework/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alirezakhosravi%2FNopFramework/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alirezakhosravi%2FNopFramework/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alirezakhosravi","download_url":"https://codeload.github.com/alirezakhosravi/NopFramework/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alirezakhosravi%2FNopFramework/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261589903,"owners_count":23181436,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["boilerplate","dotnet-core","dotnetcore","framework","nopcommerce","nopframework"],"created_at":"2025-06-24T02:04:36.702Z","updated_at":"2025-06-24T02:04:37.199Z","avatar_url":"https://github.com/alirezakhosravi.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ASP.net Core Development Framework\n###### Derived from NopCommerce\n\nBy fast growing of NopCommerce usage and numerous developers who are familiar with this e-commerce solution and based on the fact that the design and architecture of this platform is well-formed and very easy to understand and develop, I've derived this fundamental development framework from [V4.1 of NopCommerce](https://github.com/nopSolutions/nopCommerce).\nThis solution is a boilerplate for creating any .net Core web application.\nI'll be adding some other capabilities and components to this primitive solution in future versions.\n\n\nFeel free to ask any question: alirezakhosravi [at] live.com\n\n### To create searchable entity follow this code:\nYour entity must implement ISearchable interface in Nop.Core solution.\n```\npublic partial class Country : BaseEntity, ILocalizedEntity, ISearchable\n{\n    public Country()\n    {\n       Route = new RouteModel()\n       {\n           RouteUrl = \"your route url when you want show detail of entity\",\n           RouteName = \"if you predefine route, enter route name\",\n           Parameters = new List\u003cParameterType\u003e { ParameterType.Id, ParameterType.Description, ParameterType.Name}\n       };\n    }\n    \n    [NotMapped]\n    public RouteModel Route { get; }\n        ...\n}\n```\nYou should use one of RoutUrl and RouteName each time.\nParameter field must be used in route parameter, when you want to pass parameter to route.\n\n```\nRoute = new RouteModel()\n{\n   RouteUrl = \"/Country/Detail?name={0}\u0026isocode={1}\",\n   Parameters = new List\u003cParameterType\u003e { ParameterType.Name, ParameterType.Description}\n};\n```\nOn the code above the 'Name value' is replaced with {0} and the 'Description value' is replaced with {1}.\n\nIf you want to change some properties to default parameter type, you can use SearchableAttribute property and set UseFor parameter for this. In this case, ThreeLetterIsoCode is used for Description on search structure.\n```\n[Searchable(UseFor = ParameterType.Description)]\npublic string ThreeLetterIsoCode { get; set; }\n```\n\nIf you want to ignore property in search, yet you want to use this property in search structure, you can set ignore parameter as true. \n```\n[Searchable(UseFor = ParameterType.Id, Ignore = true)]\npublic string TwoLetterIsoCode { get; set; }\n```\n\nIf you use SearchableAttribute property without setting parameter, this attribute is only used to query-string for search.\n```\n[Searchable]\npublic string ThreeLetterIsoCode { get; set; }\n```\n\n### To create listener to get notification, follow this code:\nYour class must implement INotificationObserver interface in Nop.Services solution\n```\nusing Nop.Services.Notifications;\n....\n\n public class WebNotificationObserver : INotificationObserver\n {\n    private readonly INotificationHandler _notificationHandler;\n    private readonly IQueuedNotificationService _queuedNotificationService;\n    \n    public WebNotificationObserver(\n        INotificationHandler notificationHandler, \n        IQueuedNotificationService queuedNotificationService\n    )\n    {\n         _notificationHandler = notificationHandler;\n         _queuedNotificationService = queuedNotificationService;\n         \n         _notificationHandler.Register(this);\n    }\n    \n    public string Identifier =\u003e \"WebNotificationObserver\";\n    \n    public INotificationHandler Handler\n    {\n        get =\u003e _notificationHandler;\n        set =\u003e throw new NotImplementedException();\n    }\n     \n    public void Notify(QueuedNotification message)\n    {\n        if (!message.IsCheckMessage(this.Identifier))\n        {\n            ...\n            message.AddObserver(this.Identifier);\n            _queuedNotificationService.UpdateQueuedNotification(message);\n        }\n    } \n }\n```\n\nIdentifier is very important beacause when your listener observed the message,it puts it's own identifier on the message so if ,later, the observer got this message, do not process it.\n\n### Enable Ignite Cache\nTo enable ignite cache, edit ``appsettings.json`` in root directory of Nop.Web.\n```\n    \"IgniteCachingConnectionString\": [\"Address1\", \"Address2\", \"Address3\", ...],\n```\nFor enable persisted change `` \"PersistDataProtectionKeysToIgnite\" `` to `` true``.\n```\n    \"PersistDataProtectionKeysToIgnite\": true,\n```\n\n### Set Ignite to default caching\nFor Enable Ignite to default cachng set ``IgniteCachingEnabled`` attribute in ``appsettings.json`` file in root directory of Nop.Web to ``true``.\n```\n    \"IgniteCachingEnabled\": true,\n    \"IgniteCachingConnectionString\": [\"Address1\", \"Address2\", \"Address3\", ...],\n```\n\n### Temporal Table\nFor enabling temporal feauture, your entity must be inherited from ``ITemporal`` interface.\n```\n    public class User : BaseEntity, ITemporal\n    {\n        ...\n    }\n```\n\nIf you want to retrieve data at specific time, you must add `` using Nop.Data.Extensions; ``.\n```\n    public class UserServices : IUserServices\n    {\n        private readonly IRepository\u003cUser\u003e _user;\n        \n        public UserServices(IRepository\u003cUser\u003e user)\n        {\n            this._user = user;\n        }\n        \n        public List\u003cUser\u003e GetUsers()\n        {\n            return _user.TemporalTable(DateTime.Now).ToList(); // or add specific time\n        }\n        \n        public User GetUser(int id)\n        {\n            return _user.GetTemporalById(id, DateTime.Now).ToList(); // or add specific time\n        }\n    }\n```\n\n### Enable Change Traking for entity\nFor Enable Temporal Table, You must set value of ``EnableChangeTracking`` on root of Nop.Web is true, and your entity must implemented ``IChangeTraking`` interface.\n```\n public partial class User : BaseEntity, IChangeTracking\n {\n    ...\n    [NotMapped]\n    public string SYS_CHANGE_VERSION { get; set; }\n    [NotMapped]\n    public string SYS_CHANGE_CREATION_VERSION { get; set; }\n    [NotMapped]\n    public string SYS_CHANGE_OPERATION { get; set; }\n    [NotMapped]\n    public string SYS_CHANGE_COLUMNS { get; set; }\n    [NotMapped]\n    public string SYS_CHANGE_CONTEXT { get; set; }\n }\n```\nIf you want to retrieve history of data, you must add `` using Nop.Data.Extensions; ``.\n```\n   public class UserServices : IUserServices\n    {\n        private readonly IRepository\u003cUser\u003e _user;\n        \n        public UserServices(IRepository\u003cUser\u003e user)\n        {\n            this._user = user;\n        }\n        \n        public List\u003cUser\u003e GetHistory()\n        {\n            return _user.ChangeTraking().ToList();\n        }\n    } \n```\nBy default, remove history after 10 days, if you want changing this time, you must changed the ``ChangeRetention`` attribute in ``appsettings.json`` on root directory of ``Nop.Web``.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falirezakhosravi%2Fnopframework","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falirezakhosravi%2Fnopframework","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falirezakhosravi%2Fnopframework/lists"}