اشتراک‌ها
معماری های رایج برنامه های وب

Most traditional .NET applications are deployed as single units corresponding to an executable or a single web application running within a single IIS appdomain. This approach is the simplest deployment model and serves many internal and smaller public applications very well. However, even given this single unit of deployment, most non-trivial business applications benefit from some logical separation into several layers. 

معماری های رایج برنامه های وب
اشتراک‌ها
معرفی استاندارد سورس باز #C

Moving the standards work into the open, under the .NET Foundation, makes it easier for standardization work. Everything from language innovation and feature design through implementation and on to standardization now takes place in the open. It will be easier to ask questions among the language design team, the compiler implementers, and the standards committee. Even better, those conversations will be public. 

معرفی استاندارد سورس باز #C
اشتراک‌ها
شروع به کار با Visual Studio 2017

Ready to get started with Visual Studio 2017? This is your course! Join the experts and get the details, from installation to debugging, in this practical Visual Studio 2017 deep dive.

See how to download and install Visual Studio in standalone and networked environments, along with some of the configuration options, such as choosing your workloads (types of apps or services, languages, and platforms), customizing the installation, and installing language packs. Then, take a tour of the Visual Studio IDE, including all the basics you need to get started with your development projects. Finally, explore debugging in Visual Studio, and learn how to use its features to investigate problems in your code.

شروع به کار با Visual Studio 2017
فایل‌های پروژه‌ها
PdfRpt-1.9.zip
- Updated the project to use iTextSharp 5.4.1.0.
- Updated the project to use EPPlus 3.1.3. EPPlus 3.1.3 has a reference to System.Web for Uri decoding. So to use PdfReport from now on you need to change your project's target framework to full profile instead of the client profile.
- Added FlushType parameter to FlushInBrowser method. FlushType.Inline displays PDF in the browser instead of showing the download popup.
- Added EFCodeFirstMvc4Sample.
- Added PdfFilePrinter sample.
- Fixed `StartIndex cannot be less than zero` exception when parameter values are defined without defining the actual parameters in SQL data sources.
مطالب
خلاصه‌ای از روش‌های ارسال داده‌های سمت سرور به کدهای جاوا اسکریپتی در ASP.NET MVC
روش‌های زیادی برای ارسال داده‌های سمت سرور تهیه شده در یک برنامه‌ی ASP.NET به کدهای سمت کاربر JavaScript ایی وجود دارند که تعدادی از مهم‌ترین‌های آن‌ها را در این مطلب بررسی خواهیم کرد.

روش اول: دریافت اطلاعات سمت سرور به کمک درخواست‌های Ajax

استفاده از Ajax یکی از روش‌های کلاسیک دریافت اطلاعات سمت سرور در کدهای جاوا اسکریپتی است.
<script type="text/javascript">
var products = [];
$(function() {
    $.getJSON("/home/products", function(response) {
        products = response.products;
    });
});
</script>
برای نمونه در اینجا با استفاده از امکانات jQuery، درخواست Ajax ایی به سرور ارسال شده و سپس نتیجه‌ی دریافتی، به آرایه‌ی جاوا اسکریپتی products نسبت داده شده‌است.
- مزایا: استفاده از Ajax، روشی بسیار متداول و شناخته شده‌است و به کمک انواع و اقسام روش‌های بازگشت JSON از سرور، می‌توان با آن کار کرد.
- معایب: درخواست Ajax، صرفا پس از بارگذاری اولیه‌ی صفحه به سمت سرور ارسال خواهد شد و در این بین، کاربر وقفه‌ای را مشاهده خواهد کرد. همچنین در اینجا بجای یک درخواست از سرور، حداقل دو درخواست باید ارسال شوند؛ یکی برای بارگذاری صفحه‌ی اصلی و دیگری برای دریافت اطلاعات Ajax ایی از سرور به صورت غیرهمزمان.


روش دوم: دریافت اطلاعات از یک فایل جاوا اسکریپتی خارجی

اطلاعات سمت کاربر را از یک فایل جاوا اسکریپتی خارجی الحاق شده‌ی به صفحه‌ی جاری نیز می‌توان تهیه کرد:
 <script src="/file.js"></script>
یک چنین فایلی را می‌توان توسط کدهای سمت سرور نیز بازگشت داد و اطلاعات آن‌را تهیه و پر کرد. در این حالت فقط کافی است که ContentType شیء Response را از نوع application/javascript مشخص کنیم و سپس یک خروجی متنی جاوا اسکریپتی را از سمت سرور بازگشت دهیم.
این روش نیز تقریبا مانند حالت یک درخواست Ajax ایی کار می‌کند و اطلاعات مورد نیاز را در طی یک درخواست جداگانه، پس از بارگذاری صفحه‌ی اصلی، از سرور دریافت خواهد کرد. البته در حالت کار با Ajax، می‌توان در طی یک callback، نتیجه را دریافت کرد و سپس عکس العمل نشان داد؛ اما در اینجا callback ایی وجود ندارد.


روش سوم: استفاده از SignalR

در SignalR ابتدا سعی می‌شود تا با استفاده از Web Sockets ارتباطی ماندگار بین کلاینت و سرور برقرار شود و سپس در این حالت، سرور می‌تواند مدام اطلاعاتی، مانند تغییرات داده‌های خود را به سمت کاربر، جهت نمایش و یا محاسبات خاص خود ارسال کند. اگر حالت Web Socket میسر نباشد (توسط سرور یا کلاینت پشتیبانی نشود)، به حالت‌های دیگری مانند server events, forever frames, long polling سوئیچ خواهد کرد. اطلاعات بیشتر


روش چهارم: قرار دادن اطلاعات سمت سرور در کدهای HTML صفحه

روش متداول دیگری جهت تامین اطلاعات جاوا اسکریپتی سمت کاربر، قرار دادن آن‌ها در ویژگی‌های data-* ارائه شده در HTML5 است.
<ul>
@foreach (var product in products)
{
  <li id="product@product.Id" data-rank="@product.Rank">@product.Name</li>
}
</ul>
در اینجا لیستی از محصولات، به صورت متداولی از کنترلر دریافت گردیده و سپس ویژگی data-rank هر ردیف نمایش داده شده نیز توسط این اطلاعات سمت سرور مقدار دهی شده‌اند.
اکنون برای دسترسی به مقدار data-rank سطری مانند product1، در کدهای جاوا اسکریپتی صفحه می‌توان نوشت:
<script type="text/javascript">
var product1Rank = $("#product1").data("rank");
</script>
این روش برای قرار دادن اطلاعات ثابت اشیاء، روش مرسومی است.


روش پنجم: قرار دادن اطلاعات سمت سرور در کدهای جاوا اسکریپتی صفحه

این روش همانند روش چهارم است، با این تفاوت که اینبار اطلاعات مورد نیاز، مستقیما به یک متغیر جاوا اسکریپتی انتساب داده شده‌است:
 <script type="text/javascript">
var product1Name = "@product1.Name";
</script>
مزیت این روش، عدم ارسال درخواست اضافه‌تری به سرور برای دریافت اطلاعات مورد نیاز است. مقدار product1Name در همان بار اول رندر صفحه از سمت سرور، مشخص می‌گردد.


روش ششم: انتساب یک شیء دات نتی به یک متغیر جاوا اسکریپتی

این روش همانند روش پنجم است، با این تفاوت که اینبار قصد داریم بجای یک مقدار ثابت رشته‌ای یا عددی، برای مثال، آرایه‌ای از اشیاء را به یک متغیر جاوا اسکریپتی انتساب دهیم. در اینجا ابتدا اطلاعات مورد نظر را به فرمت JSON تبدیل می‌کنیم:
//سمت سرور
[HttpGet]
public ActionResult Index()
{
    var array = new[]
    {
        "Afghanistan",
        "Albania",
        "Algeria",
        "American Samoa",
        "Andorra",
        "Angola",
        "Anguilla",
        "Antarctica",
        "Antigua and/or Barbuda"
     };
     ViewBag.JsonString = new JavaScriptSerializer().Serialize(array);
     return View();
}
سپس توسط متد Html.Raw می‌توان این رشته‌ی JSON را که اکنون حاوی آرایه جاوا اسکریپتی سمت سرور است، به یک متغیر جاوا اسکریپتی نسبت داد:
 //سمت کلاینت
<script type="text/javascript">
var jsonArray = @Html.Raw(@ViewBag.JsonString);
</script>
استفاده از Html.Raw در این حالت از این جهت ضروری است که اطلاعاتی مانند [] به صورت encode شده در سمت کاربر نمایش داده نشوند؛ چون Razor به صورت پیش فرض اطلاعات را Encode می‌کند.
و یا اینکار را به صورت خلاصه به شکل زیر نیز می‌توان در سمت کاربر انجام داد:
 <script type="text/javascript">
  var model = @Html.Raw(Json.Encode(Model));
  // your js code here
</script>
در اینجا کار تبدیل اطلاعات مدل به JSON، در همان سمت RazorView انجام شده‌است.
اشتراک‌ها
Visual Studio 2019 version 16.6.0 منتشر شد

Top Issues Fixed in Visual Studio 2019 version 16.6.0

  • When New Git experience feature flag is enabled, a message will appear in Team Explorer guiding users to the new Git tool window.
  • Fix for intermittent UI delay while closing VS when WinForms .NET Core designer is in open state.
  • Fixed issues creating projects using type providers, throwing missing method exception at runtime.
  • Fixed project creation for .NET framework projects.
  • New find in files experience respects options in Tools-Options-Find and Replace pane.
  • Fixed a bug where Git repository does not change when closing a Folder and opening a Solution.
  • Fixed bug when building iOS app using full debug symbols.
  • Added back browing of Mac Distribution provisioning profiles and certificates from Windows.
  • Fixed a bug causing Visual Studio 2019 to stop responding when working with Xamarin projects on certain scenarios.
  • Added keyboard shortcut for "Copy with Headers" option in SQL Script Results Grid
  • SSDT users will now be able to set and view sensitivity properties for all version above SQL Server 2008
  • Improve Connection Properties dialog for accessibility users.
  • Fixed occasional crashes when using Tested By Code Lens indicator.
  • Ensure auto population of text in Find in files is as per legacy behavior.
  • Ensure left arrow key behavior in find in files is correct.
  • An issue blocking C++ users of the C++20 Ranges library from using algorithms. 
Visual Studio 2019 version 16.6.0 منتشر شد
اشتراک‌ها
ده مقاله برتر Visual Studio Magazine از سری "چگونه" در سال 2012
این ده مقاله به شرح زیر می‌باشند:

10) Practical .NET: Powerful JavaScript With Upshot and Knockout
The Microsoft JavaScript Upshot library provides a simplified API for retrieving data from the server and caching it at the client for reuse. Coupled with Knockout, the two JavaScript libraries form the pillars of the Microsoft client-side programming model.

9) On VB: Database Synchronization with the Microsoft Sync Framework
The Microsoft Sync Framework is a highly flexible framework for synchronizing files and data between a client and a master data store. With great flexibility often comes complexity and confusion, however.

8) C# Corner: Performance Tips for Asynchronous Development in C#
Visual Studio Async is a powerful development framework, but it's important to understand how it works to avoid performance hits.

7) 2 Great JavaScript Data-Binding Libraries
JavaScript libraries help you build powerful, data-driven HTML5 apps.

6) On VB: Entity Framework Code-First Migrations
Code First Migrations allow for database changes to be implemented all through code. Through the use of Package Manager Console (PMC), commands can be used to scaffold database changes.

5) C# Corner: The New Read-Only Collections in .NET 4.5
Some practical uses for the long-awaited interfaces, IReadOnlyList and IReadOnlyDictionary, in .NET Framework 4.5.

4) C# Corner: Building a Windows 8 RSS Reader
Eric Vogel walks through a soup-to-nuts demo for building a Metro-style RSS reader.

3) C# Corner: The Build Pattern in .NET
How to separate complex object construction from its representation using the Builder design pattern in C#.

2) Inside Visual Studio 11: A Guided Tour
Visual Studio 2012 (code-named Visual Studio 11 then) is packed with new features to help you be a more efficient, productive developer. Here's your guided tour.

1) HTML5 for ASP.NET Developers
The technologies bundled as HTML5 finally support what developers have been trying to get HTML to do for decades.

 

ده مقاله برتر Visual Studio Magazine از سری "چگونه" در سال 2012