اشتراک‌ها
نگاهی به Entity Framework 7 چندسکویی

In this short video Nate shows us how to use Entity Framework 7 in a cross platform way (on a mac in this case). One of the guiding principles (as outlined by Rowan in an earlier video) was the ability to use EF7 on any kind of device. This video shows the culmination of that work.

نگاهی به Entity Framework 7 چندسکویی
اشتراک‌ها
D3 6.0 منتشر شد

D3 6.0: The Data-Driven Document Library — The popular data visualization library takes a step forward by switching out a few internal dependencies for better alternatives, adopts ES2015 (a.k.a. ES6) internally, and now passes events directly to listeners. There’s also a 5.x to 6.0 migration guide for existing users. 

D3 6.0 منتشر شد
اشتراک‌ها
معرفی Redgate University

The Redgate Hub provides a wealth of free technical articles and videos and recently even more content has been added to the university. New courses include guidance for setting up your own demo environment, a course on unboxing SQL Cone, and a guide to testing your Database DevOps readiness. 

معرفی Redgate University
مطالب
اصول برنامه نویسی موازی درNET. نسخه 4 بخش اول - 2
تنظیم وضعیت برای یک Task  
در مثال ذکر شده در قسمت قبل هر چهار Task یک عبارت را در خروجی نمایش دادند حال می‌خواهیم هر Task پیغام متفاوتی را نمایش دهد.برای این کار از کلاس زیر استفاده می‌کنیم :  
System.Action<object>
تنظیم وضعیت برای یک Task این امکان را فراهم می‌کند که بر روی اطلاعات مختلفی یک پروسه مشابه را انجام داد.

مثال :  

namespace Listing_03 {
class Listing_03 {
  static void Main(string[] args) {
   // use an Action delegate and a named method
   Task task1 = new Task(new Action<object>(printMessage),"First task");

   // use an anonymous delegate
   Task task2 = new Task(delegate (object obj) {
     printMessage(obj);
   }, "Second Task");

   // use a lambda expression and a named method
   // note that parameters to a lambda don't need
   // to be quoted if there is only one parameter
   Task task3 = new Task((obj) => printMessage(obj), "Third task");

   // use a lambda expression and an anonymous method
   Task task4 = new Task((obj) => {
    printMessage(obj);
   }, "Fourth task");

  task1.Start();
  task2.Start();
  task3.Start();
  task4.Start();

  // wait for input before exiting
  Console.WriteLine("Main method complete. Press enter to finish.");
  Console.ReadLine();
}

 static void printMessage(object message) {
   Console.WriteLine("Message: {0}", message);
  }
 }
}
کد بالا را بروش دیگری هم می‌توان نوشت :  
using System;
using System.Threading.Tasks;

namespace Listing_04 {
class Listing_04 {
  static void Main(string[] args) {
   string[] messages = { "First task", "Second task",
    "Third task", "Fourth task" };

   foreach (string msg in messages) {
     Task myTask = new Task(obj => printMessage((string)obj), msg);
     myTask.Start();
  }

  // wait for input before exiting
  Console.WriteLine("Main method complete. Press enter to finish.");
  Console.ReadLine();
}

  static void printMessage(string message) {
   Console.WriteLine("Message: {0}", message);
  }
 }
}
نکته مهم در کد بالا تبدیل اطلاعات وضعیت Task به رشته کاراکتری است که در عبارت لامبدا مورد استفاده قرار می‌گیرد. System.Action فقط با داده نوع object کار می‌کند.
خروجی برنامه بالا بصورت زیر است :  
Main method complete. Press enter to finish.

Message: Second task

Message: Fourth task

Message: First task

Message: Third task
البته این خروجی برای شما ممکن است متفاوت باشد چون در سیستم شما ممکن است Task‌ها با ترتیب متفاوتی اجرا شوند.با کمک Task Scheduler برا حتی می‌توان ترتیب اجرای Task‌ها را کنترل نمود  

اشتراک‌ها
Rider 2024.2.5 منتشر شد
Rider 2024.2.5 is available! In this release, we’ve fixed a set of highly upvoted issues, including troublesome behavior in Rider when file analysis would stop. Update at your earliest convenience to ensure that your syntax and semantic highlighting, navigation, and other smart features are working correctly. We sincerely apologize for any inconvenience caused by this issue! Learn more and download the update here: https://jetbrains.com/rider/download/


Rider 2024.2.5 منتشر شد