اشتراک‌ها
کتاب رایگان ASP.NET WebHooks Succinctly

Taking advantage of WebHooks is something that many developers want to achieve, but many struggle to find a starting point. In ASP.NET WebHooks Succinctly, Gaurav Arora guides readers through the necessary skills and processes to get started.

Table of Contents
  1. Introduction
  2. Working with WebHooks
  3. Creating a Real-Time Application
  4. Creating a WebHook Receiver
  5. Writing Senders
  6. Diagnostics
  7. Tips & Tricks 
کتاب رایگان ASP.NET WebHooks Succinctly
نظرات مطالب
پیاده سازی UnitOfWork به وسیله MEF
من کلاسهام به این شکله:
کلاس کانتکس‌های من
 public class VegaContext : DbContext, IUnitOfWork, IDbContext
    {
#region Constructors (2) 

        /// <summary>
        /// Initializes the <see cref="VegaContext" /> class.
        /// </summary>
        static VegaContext()
        {
            Database.SetInitializer<VegaContext>(null);
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="VegaContext" /> class.
        /// </summary>
        public VegaContext() : base("LocalSqlServer") { }

#endregion Constructors 

#region Properties (2) 

        /// <summary>
        /// Gets or sets the languages.
        /// </summary>
        /// <value>
        /// The languages.
        /// </value>
        public DbSet<Language> Languages { get; set; }

        /// <summary>
        /// Gets or sets the resources.
        /// </summary>
        /// <value>
        /// The resources.
        /// </value>
        public DbSet<Resource> Resources { get; set; }

#endregion Properties 

#region Methods (2) 

// Public Methods (1) 

        /// <summary>
        /// Setups the specified model builder.
        /// </summary>
        /// <param name="modelBuilder">The model builder.</param>
        public void Setup(DbModelBuilder modelBuilder)
        {
            //todo
            modelBuilder.Configurations.Add(new ResourceMap());
            modelBuilder.Configurations.Add(new LanguageMap());
            modelBuilder.Entity<Resource>().ToTable("Vega_Languages_Resources");
            modelBuilder.Entity<Language>().ToTable("Vega_Languages_Languages");
            //base.OnModelCreating(modelBuilder);
        }
// Protected Methods (1) 

        /// <summary>
        /// This method is called when the model for a derived context has been initialized, but
        /// before the model has been locked down and used to initialize the context.  The default
        /// implementation of this method does nothing, but it can be overridden in a derived class
        /// such that the model can be further configured before it is locked down.
        /// </summary>
        /// <param name="modelBuilder">The builder that defines the model for the context being created.</param>
        /// <remarks>
        /// Typically, this method is called only once when the first instance of a derived context
        /// is created.  The model for that context is then cached and is for all further instances of
        /// the context in the app domain.  This caching can be disabled by setting the ModelCaching
        /// property on the given ModelBuidler, but note that this can seriously degrade performance.
        /// More control over caching is provided through use of the DbModelBuilder and DbContextFactory
        /// classes directly.
        /// </remarks>
        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Configurations.Add(new ResourceMap());
            modelBuilder.Configurations.Add(new LanguageMap());
            modelBuilder.Entity<Resource>().ToTable("Vega_Languages_Resources");
            modelBuilder.Entity<Language>().ToTable("Vega_Languages_Languages");
            base.OnModelCreating(modelBuilder);
        }

#endregion Methods 

        #region IUnitOfWork Members
        /// <summary>
        /// Sets this instance.
        /// </summary>
        /// <typeparam name="TEntity">The type of the entity.</typeparam>
        /// <returns></returns>
        public new IDbSet<TEntity> Set<TEntity>() where TEntity : class
        {
            return base.Set<TEntity>();
        }
        #endregion
    }
در تعاریف کلاسهایی که از IDBContext ارث می‌برن اکسپورت شدن (این یک نمونه از کلاس‌های منه)
در طرف دیگر برای لود کردن کلاس زیر نوشتم
public class LoadContexts
    {
        public LoadContexts()
        {
            var directoryPath = HttpRuntime.BinDirectory;//AppDomain.CurrentDomain.BaseDirectory; //"Dll folder path";

            var directoryCatalog = new DirectoryCatalog(directoryPath, "*.dll");

            var aggregateCatalog = new AggregateCatalog();
            aggregateCatalog.Catalogs.Add(directoryCatalog);

            var container = new CompositionContainer(aggregateCatalog);
            container.ComposeParts(this);
        }

        //[Import]
        //public IPlugin Plugin { get; set; }

        [ImportMany]
        public IEnumerable<IDbContext> Contexts { get; set; }
    }
و در کانتکس اصلی برنامه این پلاگین هارو لود می‌کنم
public class MainContext : DbContext, IUnitOfWork
    {
        public MainContext() : base("LocalSqlServer") { }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            base.OnModelCreating(modelBuilder);
            var contextList = new LoadContexts(); //ObjectFactory.GetAllInstances<IDbContext>();
            foreach (var context in contextList.Contexts)
                context.Setup(modelBuilder);

            Database.SetInitializer(new MigrateDatabaseToLatestVersion<MainContext, Configuration>());
            //Database.SetInitializer(new DropCreateDatabaseAlways<MainContext>());
        }

        /// <summary>
        /// Sets this instance.
        /// </summary>
        /// <typeparam name="TEntity">The type of the entity.</typeparam>
        /// <returns></returns>
        public IDbSet<TEntity> Set<TEntity>() where TEntity : class
        {
            return base.Set<TEntity>();
        }
    }
با موفقیت همه پلاگین‌ها لود میشه و مشکلی در عملیات نیست. اما Attribute‌های کلاس هارو نمیشناسه. مثلا پیام خطا تعریف شده در MVC نمایش داده نمیشه چون وجود نداره ولی وقتی کلاس مورد نظر از IValidatableObject  ارث میبره خطای‌های من نمایش داده میشه. می‌خوام از خود متادیتاهای استاندارد استفاده کنم.



اشتراک‌ها
استفاده توامان دات نت و داکر

Many developers I talk to are either using Docker actively or planning to adopt containers in their environment. Containers are an important trend in our industry and .NET is part of that. Microsoft and Docker have been working together so that you’ll have a great experience using Docker with .NET apps. 

استفاده توامان دات نت و داکر
اشتراک‌ها
لیست جلسات کنفرانس NET Fringe 2015.

".NET Fringe is a new conference focused on .NET developers who are breaking the rules and pushing the boundaries. The .NET platform is more interesting today than it ever has been! The old Microsoft that was at odds with Open Source has been replaced with on

لیست جلسات کنفرانس NET Fringe 2015.
اشتراک‌ها
قسمت چهارم از سری مجموعه Concurrency و Asynchrony

قسمت 4- تو این ویدیو کامل مباحثی مثل Lock وMonitor وMutex وSemaphore رو بررسی کردیم و 2 نمونه از همزمانی و ددلاک رو هم توی کد دیدیم.

1:00 Why do we call the worker thread
2:47 Deadlock
09:29 Monitor and lock the object
12:36 lock(){} is Monitor
13:15 Mutex/ Semaphore/ SemaphoreSlim

لطفا در چنل یوتیوب ما عضو شوید، عضو شدن شما میتونه انرژی خوبی برای ما باشه برای تولید محتوهای بعدی، ممنونم .


مدت ویدیو : 22 دقیقه 

قسمت چهارم از سری مجموعه Concurrency و Asynchrony
اشتراک‌ها
مجموعه نکاتی از VS Code

In this article, I'm going to talk about some of my favorite tips and tricks about my favorite IDE, VS Code. Although I'm writing this on a Mac, many of these concepts will port to Windows, so you may have to replace COMMAND key, WIN key, etc.

مجموعه نکاتی از VS Code
اشتراک‌ها
مبانی Redis برای توسعه دهندگان دات نت

Redis Fundamentals for .NET Developers

Redis is an open source, in-memory data store used by millions of developers as a database, cache, streaming engine, and even a message broker.
In this live sessions, Stephen Lorello, Senior Field Engineer at Redis, joins us to show the the fundamental features .NET developers show know about using Redis 

مبانی Redis برای توسعه دهندگان دات نت
اشتراک‌ها
از کند شدن Entity Framework دوری کنید
Generally speaking, I don't worry much about tweaking my LINQ queries when working with Entity Framework (this is also true when I'm working with SQL directly, by the way). I'm always telling my clients that if they want to speed up their data access they should look at their database design and, especially, how they're using indexes.
از کند شدن Entity Framework دوری کنید
اشتراک‌ها
جداول Temporal در SQL Server 2016

provide information about data stored in the table at any point in time rather than only the data that is correct at the current moment in time. Temporal is a database feature that was introduced in ANSI SQL 2011 and is now supported in SQL Server 2016 Community Technology Preview 2 (CTP2).

جداول Temporal در SQL Server 2016
اشتراک‌ها
سیستم عامل Windows Core چیست؟ آیا آینده Windows است؟

A unified Windows operating system across all devices, from Windows desktops to Xbox One. How does that sound? Well, that’s what Windows Core OS is all about.

Though Microsoft has not officially released it yet, there is a lot of expectation online about this operating system and its potential to change the world of smart devices. 

سیستم عامل Windows Core چیست؟ آیا آینده Windows است؟