اشتراک‌ها
Mock کردن HttpClient برای تست نویسی توسط کتابخانه MockHttp

MockHttp is a testing layer for Microsoft's HttpClient library. It allows stubbed responses to be configured for matched HTTP requests and can be used to test your application's service layer. 

var mockHttp = new MockHttpMessageHandler();

// Setup a respond for the user api (including a wildcard in the URL)
mockHttp.When("http://localhost/api/user/*")
        .Respond("application/json", "{'name' : 'Test McGee'}"); // Respond with JSON

// Inject the handler or client into your application code
var client = mockHttp.ToHttpClient();

var response = await client.GetAsync("http://localhost/api/user/1234");
// or without async: var response = client.GetAsync("http://localhost/api/user/1234").Result;

var json = await response.Content.ReadAsStringAsync();

// No network connection required
Console.Write(json); // {'name' : 'Test McGee'}


Mock کردن HttpClient برای تست نویسی توسط کتابخانه MockHttp
اشتراک‌ها
SQL Server® 2014 Service Pack 1 منتشر شد

A few of the customer-requested updates in Microsoft SQL Server 2014 SP1 are:

  • Column store performance is improved when batch mode operators spill over to disk. A new XEvent provides insights into column store inserts.
  • Several issues in buffer pool extension SSD configuration are addressed, including the ability to do instant initialization of the buffer pool extension file.
  • Certain queries compile faster when using new cardinality estimator, and other cardinality estimation query plans are more efficient when using TF-4199. 
  • The scalability benefits of two trace flags (TF-1236, TF-9024) are applied automatically.
  • Backup header information retrieval works better with encrypted backups.
SQL Server® 2014 Service Pack 1 منتشر شد
اشتراک‌ها
ایا معمار نرم افزار هستید؟

....

Becoming a software architect isn't something that simply happens overnight or with a promotion. It's a role , not a rank . It's an evolutionary process where you'll gradually gain the experience and confidence that you need to undertake the role.

 ...
5. Architecture collaboration: It's unusual for any software system to live in isolation and there are a number of people that need to understand it. This ranges from the immediate development team who need to understand and buy in to the architecture,  right through to other stakeholders who have an interest from a security, database, operations, maintenance, support, etc point of view 
ایا معمار نرم افزار هستید؟
اشتراک‌ها
کتابخانه jquery-lockfixed

lockfixed is a jQuery plugin which allows for DOM elements to be positioned anywhere on the page, and lock within the user's viewport when scrolling. Common use case is a menu under a header, which on scrolling stays within the viewport and doesn't overflow the footer.

Degrades nicely on mobile and tablet browsers and doesn't have any CSS prerequisites.  Demo

کتابخانه jquery-lockfixed
اشتراک‌ها
تفاوت اعتبارسنجی ورودی ها با اعتبارسنجی مرتبط با قواعد تجاری

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. 

تفاوت اعتبارسنجی ورودی ها با اعتبارسنجی مرتبط با قواعد تجاری
بازخوردهای دوره
انتقال خودکار Data Annotations از مدل‌ها به ViewModelهای ASP.NET MVC به کمک AutoMapper
نسخه 5.2.0 Automapper 
چگونه از member هایی که map نشده اند چشم پوشی کنیم؟
به عنوان مثال در LoginViewModel  تنها نیاز است نام کاربری و رمز عبور را دریافت کنیم اما در مدل اصلی یعنی User فیلد‌های دیگر هم وجود دارد.
برای این کار از کد زیر استفاده کردم اما باز هم با استثنا رخ می‌دهد.
   public LoginProfile()
   {
      CreateMap<LoginViewModel, User>().ForAllMembers(_ => _.Ignore());
      CreateMap<LoginViewModel, User>().ForMember(_ => _.UserName , __ => __.MapFrom(_ => _.UserName));
      CreateMap<LoginViewModel, User>().ForMember(_ => _.PasswordHash , __ => __.MapFrom(_ => _.Password));
   }

استثنا :
Unmapped members were found. Review the types and members below.
Add a custom mapping expression, ignore, add a custom resolver, or modify the source/destination type
For no matching constructor, add a no-arg ctor, add optional arguments, or map all of the constructor parameters
==========================================================================================
LoginViewModel -> User (Destination member list)
App.ViewModel.Enities.Identity.LoginViewModel -> App.DomainClasses.Entities.Identity.User (Destination member list)

Unmapped properties:
FirstName
LastName
IsSystemAccount
IsBan
RegisterDate
LastLoginDate
RowVersion
City
CityId
 // more ...

اشتراک‌ها
انتشار Blazorise v1.0

Today, we are happy to announce the long-awaited release of Blazorise 1.0. In this post, we're covering many new Blazorise features that will make your app development easier to build and use, along with some of the API changes required to get you started.  

انتشار Blazorise v1.0