مطالب
استفاده از چند دکمه با عملکردهای مختلف برای ارسال یک EditForm در Blazor
به صورت پیش فرض یک EditForm تنها یک دکمه‌ی submit دارد و معمولا برای اعتبارسنجی فرم، قبل از ارسال اطلاعات به شکل زیر از آن استفاده می‌شود:
<EditForm Model="@selectedCar" OnValidSubmit="@SaveObject">
    <DataAnnotationsValidator />
    <ValidationSummary />

    ....My <InputText>'s for all values I have in my object

    <button type="submit" value="Save">Save</button>    
</EditForm>
@code {
    [Parameter]
    public string Id { get; set; }

    CarModel selectedCar;

    protected override async Task OnInitializedAsync()
    {
        selectedCar = await _CarService.GetCar(int.Parse(Id));
    }

    protected async Task SaveObject()
    {
        selectedCar.Id = await _CarService.SaveCar(selectedCar);
    }    
}
حال اگر بخواهیم از چند دکمه با عملکردهای مختلفی در یک EditForm استفاده کنیم چه؟ آیا امکان آن وجود دارد که برای یک دکمه اعتبارسنجی صورت پذیرد، اما برای دکمه‌ی دیگری در همان EditForm هیچ اعتبارسنجی اعمال نشود؟
پاسخ: بله؛ می‌توان به شکل زیر عمل نمود:
<EditForm Model="@selectedCar" Context="formContext">
    <DataAnnotationsValidator />
    <ValidationSummary />

    ....My <InputText>'s for all values I have in my object

    <button type="submit" @onclick="@(() => SaveCar(formContext))">Save</button>
    <button type="submit" @onclick="@(() => UpdateStockQuantity(formContext))">Update stock quantity</button>
    <button type="submit" @onclick="@(() => DeleteCar(formContext))">Delete</button>
</EditForm>

@code {
    [Parameter]
    public string Id { get; set; }

    CarModel selectedCar;

    protected override async Task OnInitializedAsync()
    {
        selectedCar = await _CarService.GetCar(int.Parse(Id));
    }

    protected async Task SaveCar(EditContext formContext)
    {
        bool formIsValid = formContext.Validate();
        if (formIsValid == false)
            return;

        selectedCar.Id = await _CarService.SaveCar(selectedCar);
    }

     protected async Task DeleteObject(EditContext formContext)
    {
        selectedCar.Id = await _CarService.DeleteCar(selectedCar);
    }   

    // ... plus same approach with UpdateStockQuantity.
}
در اینجا به جای OnValidSubmit، از Context استفاده می‌کنیم و توسط Anonymous Function ها، متدهای مربوط به onclick‌ها را صدا می‌زنیم و formContext را به آن‌ها منتقل می‌نماییم. برای اعتبارسنجی نیز در متد مربوطه با استفاده از Context.Validate اعتبار فرم را برای متد مربوطه چک می‌کنیم. قاعدتا نیازی نیست موقع حذف یک خودرو، اعتبارسنجی فرم، برای نام آن خودرو انجام گردد؛ اما برای ثبت یک خودرو ممکن است بخواهیم مطمئن شویم که حتما نامی برای آن اختیار شود.
اشتراک‌ها
مشخصات یک ایمیل خوب

Email communication is not my favorite but since I can’t avoid it, I am trying to compose messages in a way that I think it makes it easier for both me and the recipient:
- to quickly address what is being communicated
- avoid misunderstandings
- save time
 

مشخصات یک ایمیل خوب
اشتراک‌ها
به خودتون قول بدید بین زندگی و کار توازن برقرار کنید

I was having a chat with a new friend today and we were exchanging stories about being working parents. I struggle with kids' schedules, days off school I failed to plan for, unexpected things (cars break down, kids get sick, life happens) while simultaneously trying to "do my job."  

به خودتون قول بدید بین زندگی و کار توازن برقرار کنید
اشتراک‌ها
ساخت Custom Tool سفارشی در Visual Studio 2015
I have found a few descriptions in the net how to write a Custom Tool (Single File Generator) for Visual Studio but - mainly - the registration process had been an obstacle for me. Finally, I have come to a good point in my learning curve, and I am writing it up here all together for the community. 
ساخت Custom Tool سفارشی در  Visual Studio 2015
اشتراک‌ها
حداقل‌ نیازهای مدیریت یک پروژه‌ی بزرگ

Basic Things

After working on the initial stages of several largish projects, I accumulated a list of things that share the following three properties:

  • they are irrelevant while the project is small,
  • they are a productivity multiplier when the project is large,
  • they are much harder to introduce down the line.

حداقل‌ نیازهای مدیریت یک پروژه‌ی بزرگ
اشتراک‌ها
تاریخ NET Conf 2024. مشخص شد، ۱۲ تا ۱۴ نوامبر، رهانش نهایی دات‌نت ۹

We are thrilled to announce the highly anticipated .NET Conf 2024, a free, three-day virtual developer event celebrating the release of .NET 9. Co-organized by the .NET community and Microsoft, this annual tradition continues to grow, and we’re more excited than ever to bring you the latest innovations in .NET. Mark your calendars for November 12th to 14th, 2024, and prepare to be inspired by a wealth of knowledge, creativity, and community engagement.

تاریخ NET Conf 2024. مشخص شد، ۱۲ تا ۱۴ نوامبر، رهانش نهایی دات‌نت ۹
نظرات مطالب
React 16x - قسمت 1 - معرفی و شروع به کار
اگر نسخه Node >= 8.10  و  npm >= 5.6 را نصب دارید. با دستور زیر میتوان پروژه ای ایجاد نمود:
npx create-react-app my-app
cd my-app
npm start
ابزار npx  یک package runner می باشد که از نسخه npm 5.2 به بعد در دسترس می‌باشد. 
اشتراک‌ها
ReSharper Ultimate 2016.1.1 منتشر شد

ReSharper 2016.1.1. The update helps ReSharper see controllers outside of ASP.NET MVC areas and folders again (RSRP-458398, RSRP-455213); adds smart, license-aware update checks; enables bulk renaming in TypeScript (RSRP-458570); fixes Go to Everything so that it works after suspending and resuming ReSharper (RSRP-458404); improves performance in solutions with large JavaScript and JSON files (RSRP-458363); fixes pessimistic mode in value analysis (RSRP-458210); makes IL Viewer available via the Navigate To pop-up (RSRP-458323); improves details of ReactJS support (RSRP-458229, RSRP-458242, RSRP-458308). See all fixes in ReSharper 2016.1.1.  

ReSharper Ultimate 2016.1.1 منتشر شد