اشتراک‌ها
SQL Server Management Studio 18.6 منتشر شد

The 18.6 release is the  second  major release of SSMS in 2020  and packs  several high  impact   changes , including a fix for  crashes in database diagram s.  Key fixes include:    

  • Save to XEL file error fix.  
  • B acpac  file  import  error fix.  
  • Database diagrams crash fix.  
  • Addressed sources o f three common application hangs.  
SQL Server Management Studio 18.6 منتشر شد
نظرات مطالب
اعمال تزریق وابستگی‌ها به مثال رسمی ASP.NET Identity
سلام با کد ذیل _userStore واسه من نال بر میگردونه
using System.Data.Entity;
using System.Threading.Tasks;
using Microsoft.AspNet.Identity.EntityFramework;
using SmartMarket.Core.Domain.Members;
using SmartMarket.Data;

namespace SmartMarket.Services.Members
{
    /// <summary>
    /// The ApplicationUserStore Class 
    /// </summary>
    public class ApplicationUserStore : UserStore<User, Role, int, UserLogin, UserRole, UserClaim>, IApplicationUserStore
    {
#region Fields (1) 

        private readonly IDbSet<User> _userStore;

#endregion Fields 

#region Constructors (2) 

        /// <summary>
        /// Initializes a new instance of the <see cref="ApplicationUserStore" /> class.
        /// </summary>
        /// <param name="dbContext">The database context.</param>
        public ApplicationUserStore(DbContext dbContext) : base(dbContext) { }

        /// <summary>
        /// Initializes a new instance of the <see cref="ApplicationUserStore"/> class.
        /// </summary>
        /// <param name="context">The context.</param>
        public ApplicationUserStore(IdentityDbContext context)
            : base(context)
        {
            _userStore = context.Set<User>();
 
        }

#endregion Constructors 

#region Methods (2) 

// Public Methods (2) 

        /// <summary>
        /// Adds to previous passwords asynchronous.
        /// </summary>
        /// <param name="user">The user.</param>
        /// <param name="password">The password.</param>
        /// <returns></returns>
        public Task AddToPreviousPasswordsAsync(User user, string password)
        {
            user.PreviousUserPasswords.Add(new PreviousPassword { UserId = user.Id, PasswordHash = password });
            return UpdateAsync(user);
        }

        /// <summary>
        /// Finds the by identifier asynchronous.
        /// </summary>
        /// <param name="userId">The user identifier.</param>
        /// <returns></returns>
        public override Task<User> FindByIdAsync(int userId)
        {
            return Task.FromResult(_userStore.Find(userId));
        }

#endregion Methods 

        /// <summary>
        /// Creates the asynchronous.
        /// </summary>
        /// <param name="user">The user.</param>
        /// <returns></returns>
        public override async Task CreateAsync(User user)
        {
            await base.CreateAsync(user);
            await AddToPreviousPasswordsAsync(user, user.PasswordHash);
        }
    }
}
اشتراک‌ها
انتشار اولین نسخه پیش‌نمایش انتیتی فریم‌ورک ۸

The first preview of Entity Framework Core (EF Core) 8 is available on NuGet today!

Basic information

EF Core 8, or just EF8, is the successor to EF Core 7, and is scheduled for release in November 2023, at the same time as .NET 8.

EF8 currently targets .NET 6. This will likely be updated to .NET 8 as we near release.

EF8 will align with .NET 8 as a long-term support (LTS) release. See the .NET support policy for more information. 

انتشار اولین نسخه پیش‌نمایش انتیتی فریم‌ورک ۸
اشتراک‌ها
تفاوت اعتبارسنجی ورودی ها با اعتبارسنجی مرتبط با قواعد تجاری

Input Validation for me is about validating the user input. Some people call "Name must not be empty" a business rule, I think about it as input validation. Business Rules validation is more complex, because a business rule for me is not "Name must not be empty", it is a definition of a state in the system that requires an action. Here is a definition of a business rule:

An order should be payed within 30 days, this duration can be extended, to a maximum of three times. 

تفاوت اعتبارسنجی ورودی ها با اعتبارسنجی مرتبط با قواعد تجاری
اشتراک‌ها
NET 6 Release Candidate 2. منتشر شد

We are excited to release .NET 6 Release Candidate 2. It is the second of two “go live” release candidate releases that are supported in production. For the last couple months, the team has been focused exclusively on quality improvements. There are a lot of new features in the release, which only fully come together near the end. The team is currently validating end-to-end workflows to find the places where design intentions and technical reality don’t yet fully match. That’s led to teams tightening leaky pipes and paving paths all the way to their destination. 

NET 6 Release Candidate 2. منتشر شد
اشتراک‌ها
نصب سریع postgresql در سیستم عامل ubuntu

PostgreSQL, or Postgres, is a relational database management system that provides an implementation of the SQL querying language. It’s standards-compliant and has many advanced features like reliable transactions and concurrency without read locks.

This guide demonstrates how to quickly get Postgres up and running on an Ubuntu 20.04 server, from installing PostgreSQL to setting up a new user and database. If you’d prefer a more in-depth tutorial on installing and managing a PostgreSQL database, see How To Install and Use PostgreSQL on Ubuntu 20.04. 

نصب سریع postgresql در سیستم عامل ubuntu
نظرات مطالب
ASP.NET MVC #6
مطابق استاندارد، در HTTP header امکان قرار دادن کاراکترهای یونیکد نیست (پیش فرض آن حداکثر ISO-8859-1  است یا حروف لاتین):
 Reason-Phrase  = *<TEXT, excluding CR, LF>
“The TEXT rule is only used for descriptive field contents and values that are not intended to be interpreted by the message
parser. Words of *TEXT MAY contain characters from character sets other than ISO-8859-1
only when encoded according to the rules of RFC 2047”.
مگر اینکه مطابق RFC 2047 انکد شوند. (از این RFC هم بیشتر در عنوان ایمیل‌ها تابحال استفاده شده تا در هدر HTTP)
البته می‌شود توسط HttpUtility.UrlEncode این پیام را encode و در سمت کلاینت توسط مثلا jQuery با استفاده از متد استاندارد decodeURIComponent آن‌را دریافت کرد ولی ... به صورت پیش فرض و encode نشده، تفسیر نمی‌شود و حتی به عنوان یک هدر مخرب شاید برگشت زده شود.