اشتراک‌ها
خلاصه ng-conf 2017

ng-conf 2017 Summary - Day 2 (Fair Day)
Angular v4 has been released. Read about Fair Day from ng-conf 2017 (April 6) Day 2. 

خلاصه ng-conf 2017
نظرات مطالب
یکپارچه سازی Angular CLI و ASP.NET Core در VS 2017
فایل zip پیوستی انتهای بحث را دریافت کنید. در فایل src\app\app.module.ts آن، تعریف ذیل برای معرفی HttpModule وجود دارد و بدون آن، استثنای No provider for Http را دریافت خواهید کرد:
import { HttpModule } from '@angular/http';

@NgModule({
  imports: [
    HttpModule
  ]
اشتراک‌ها
اعتبارسنجی IOptions توسط کتابخانه MiniValidation

In this post I described the problem that by default, DataAnnotation validation doesn't recursively inspect all properties in an object for DataAnnotation attributes. There are several solutions to this problem, but in this post I used the MiniValidation library from Damian Edwards. This simple library provides a convenience wrapper around DataAnnotation validation, as well as providing features like recursive validation. Finally I showed how you can replace the built-in DataAnnotation validation with a MiniValidation-based validator

var builder = WebApplication.CreateBuilder(args);

builder.Services.AddOptions<MySettings>()
    .BindConfiguration("MySettings")
    .ValidateMiniValidation() // 👈 Replace with mini validation
    .ValidateOnStart();

var app = builder.Build();
OptionsValidationException: 
  DataAnnotation validation failed for 'MySettings' member: 'Nested.Value' with errors: 'The Value field is required.'.; 
  DataAnnotation validation failed for 'MySettings' member: 'Nested.Count' with errors: 'The field Count must be between 1 and 100.'.
Microsoft.Extensions.Options.OptionsFactory<TOptions>.Create(string name)
Microsoft.Extensions.Options.OptionsMonitor<TOptions>+<>c__DisplayClass10_0.<Get>b__0()


اعتبارسنجی IOptions  توسط کتابخانه MiniValidation
اشتراک‌ها
چرا در نسخه Express ویژوال استودیو نمی شه Extension نصب کرد ؟
Microsoft's Ryan Molden said : that disallowing non-Microsoft extensions is deliberate.
We don't prevent you from INSTALLING a package to Express ,since that just means 'writing some bits into the registry ', but it will never successfully load.  As I mentioned in the other post, this is not a technological limitation, it is a business decision, one I disagree with, but I don't make these decisions
چرا در نسخه Express ویژوال استودیو نمی شه Extension نصب کرد ؟
اشتراک‌ها
ساخت برنامه‌های توزیع شده با Akka.NET

In this episode, Aaron Stannard (@Aaronontheweb) comes on to talk about his open source project, Akka.NET. This is a toolkit and runtime for building highly concurrent, distributed, and fault tolerant event-driven applications on .NET and Mono. 

ساخت برنامه‌های توزیع شده با Akka.NET
اشتراک‌ها
مدیریت رویدادها در دات نت

مدیریت رویدادها و خطاها در پشت صحنه و اجرای بعضی از رویدادها و پروسه‌های به تاخیر افتاده بعداز رفع عیب توسط این سیستم بسیار عالی.

An easy way to perform background processing in your .NET and .NET Core applications. No Windows Service or separate process required.  

مدیریت رویدادها در دات نت
نظرات مطالب
شروع به کار با AngularJS 2.0 و TypeScript - قسمت یازدهم - کار با فرم‌ها - قسمت دوم
- data binding یعنی دقیقا به روز شدن اطلاعات با تغییرات کاربر. اگر مدنظر شما نیست، به صورت دستی آن‌را مدیریت کنید. ابتدا کار اتصال به رخداد blur را انجام دهید:
<input type="text" [(ngModel)]="myModel" (blur)="onBlurMethod()">
و بعد تعریف متد معادل آن در کلاس کامپوننت:
export class AppComponent {  
   myModel: any;  

   constructor(){
          this.myModel = '123';  
   }

   onBlurMethod(){  
     alert(this.myModel);   
   }
}

+ Observableها دارای متدی هستند به نام debounceTime که برای همین منظور طراحی شده‌است. یک مثال:
export class AppComponent {
    searchForm: ControlGroup;
    results: Observable<any[]>;

    constructor(private http: Http) {
        let searchField = new Control();
        this.searchForm = new ControlGroup({searchField});
        this.results = searchField.valueChanges
                  .debounceTime(500)
                  .switchMap((val:string) => {
                         return this.search(val);
                  });
    }
البته این مورد بر روی async validation تاثیری ندارد. برای رفع این مشکل می‌توان از راه حلی مانند «Debouncing Angular 2 Input Component» و یا «How to add debounce time to an async validator in angular 2» استفاده کرد (فعلا؛ در زمان نگارش این مطلب).