نظرات مطالب
خلاصه اشتراک‌های روز دو شنبه 21 آذر 1390
http://visualstudiomagazine.com/blogs/redmond-review/2011/11/does-windows-8-spell-the-end-of-silverlight.aspxتو این لینک نوشته شده که گروه اصلی سیلورلایت به گروه Windows Azure رفته و جان پاپا هم کلا از مایکروسافت رفته البته این رو هم نوشته که نمیدونه این نسخه آخرین نسخه هست یا نه.
در این لینک هم
http://forums.silverlight.net/t/244120.aspx/2/10?When+will+Microsoft+announce+this+as+the+final+version+

Pete Brown مطالبی رو عنوان میکنه که قابل توجه هستش
اشتراک‌ها
پیاده سازی سرویس دیسکاوری با Consul

بعد از مدت‌ها دوری از این پلی لیست، گفتیم یکمی این رو هم ببریم جلو و یه ویدیو براش بسازیم در ادامه بحث مایکروسرویس ها، این سری رفتیم سراغ سرویس دیسکاوری و با Consul که از کمپانی HashiCorp هست، کار کردیم و تونستیم مایکروسرویس هارو در زمان لود رجیستر کنیم و Ocelot رو هم به این سرویس دیسکاوری وصل کنیم. 

00:00 Ocelot, API Gateway 

05:00 Implementing 2 Microservices and API Gateway 

10:08 What is Consul 

10:37 Running Consul in Docker 

15:31 Consul UI 

16:40 Self Registration Microservice into Consul 

20:28 IHostedService 

27:15 Register Services into IServiceCollection 

35:00 Connect Ocelot to Consul 

مدت زمان ویدیو : 41 دقیقه 

پیاده سازی سرویس دیسکاوری با Consul
اشتراک‌ها
مقدمه ای بر برنامه نویسی همزمان

What is concurrent programing? Simply described, it’s when you are doing more than one thing at the same time. Not to be confused with parallelism, concurrency is when multiple sequences of operations are run in overlapping periods of time. In the realm of programming, concurrency is a pretty complex subject. Dealing with constructs such as threads and locks and avoiding issues like race conditions and deadlocks can be quite cumbersome, making concurrent programs difficult to write. Through concurrency, programs can be designed as independent processes working together in a specific composition. Such a structure may or may not be made parallel; however, achieving such a structure in your program offers numerous advantages. 

مقدمه ای بر برنامه نویسی همزمان
اشتراک‌ها
لیست جلسات Microsoft Build 2020

Microsoft Build 2020 session catalog is now live, check out over 600 sessions
Over 600 sessions will happen during Microsoft Build 2020, and you can look through a catalog of all of them now. 

لیست جلسات Microsoft Build 2020
مطالب
Action و Function در OData
استفاده از OData تنها به عملیات CRUD معطوف نمیشود و در عمل شما این قابلیت را دارید که متد‌های سفارشی و کاملا مجزایی را از همدیگر در سرویس‌های خود داشته باشید.
هرچند در بعضی از سناریو‌ها نیازی به استفاده‌ی بیشتر از CRUD مربوط به آن entity وجود ندارد، اما در اکثر موارد نیاز به رفتاری دارید که به راحتی با استفاده از CRUD معمولی قابلیت پیاده سازی را ندارد. در اینگونه موارد Action‌ها و Function‌ها هستند که به راحتی با استفاده از آنها، قابلیت طراحی ماژول‌های سفارشی فراهم شده است.
Actions و Functions در عمل رفتاری شبیه به هم را دارند؛ اما تفاوت‌های آنها در این است که:
1) Action‌ها برای درخواست‌های از نوع post هستند؛ اما به عکس Function‌ها از نوع get میباشند.
2) Action‌ها اثرات جانبی دارند اما Function‌ها خیر.
3) Function‌ها حتما باید خروجی داشته باشند؛ اما این الزام برای Action‌ها وجود ندارد.
4) هر دو امکان داشتن هر تعداد پارامتری را دارند (یا بدون پارامتر).

اضافه کردن Action
فرض کنید مدل زیر را در اختیار داریم
namespace ProductService.Models
{
    public class ProductRating
    {
        public int ID { get; set; }
        public int Rating { get; set; }
        public int ProductID { get; set; }
        public virtual Product Product { get; set; }  
    }
}
حال نیاز داریم که آن را به EDM اضافه نماییم. در کانفیگ OData، نوع Conventional را استفاده کرده و ابتدا Namespaceی را تعریف کرده و سپس Action خود را تعریف مینماییم؛ به صورت زیر:
ODataModelBuilder builder = new ODataConventionModelBuilder();
builder.EntitySet<Product>("Products");

builder.Namespace = "ProductService";
builder.EntityType<Product>()
    .Action("Rate")
    .Parameter<int>("Rating");
در اینجا یک متد اکشن را به نام Rate و پارامتری را از نوع integer به نام Rating تعریف مینماییم.

اضافه کردن متد اکشن در کنترلر
[HttpPost]
public async Task<IHttpActionResult> Rate([FromODataUri] int key, ODataActionParameters parameters)
{
    if (!ModelState.IsValid)
    {
        return BadRequest();
    }

    int rating = (int)parameters["Rating"];
    db.Ratings.Add(new ProductRating
    {
        ProductID = key,
        Rating = rating
    });

    await db.SaveChangesAsync();
    
    return StatusCode(HttpStatusCode.NoContent);
}
توجه کنید که نام متد نوشته شده، همنام اکشنی است که قبلا تعریف کرده‌ایم. کار ODataActionParameters گرفتن پارامتر‌های ارسالی از سمت کلاینت میباشد. دقت کنید که نام پارامتر را نیز تعیین کرده بودیم.
ذکر [HttpPost] برای تعیین کردن post بودن این متد است. برای فراخوانی این اکشن از سمت کلاینت، درخواستی را از نوع post، بدین شکل ارسال مینماییم:
POST http://localhost/Products(1)/ProductService.Rate HTTP/1.1
Content-Type: application/json
Content-Length: 12

{"Rating":5}
توجه داشته باشید که ProductService همان Nampespaceی است که در کانفیگ تعیین کرده بودیم.
و البته برای فراخوانی این درخواست توسط یک کلاینت C#ی، اینگونه رفتار میکنیم (در مقاله‌های آتی از C# Odata client برای فراخوانی درخواست‌ها به صورت strongly typed استفاده خواهیم نمود)
HttpClient client = new HttpClient();
var response = client.PostAsync(postUrl, new StringContent(JsonConvert.SerializeObject(new { Rating = 5 }), Encoding.UTF8, "application/json")).Result;

اضافه کردن متد Function
برای اضافه کردن متد فانکشن نیز ابتدا باید آن را در کانفیگ OData معرفی نماییم؛ به صورت زیر:
ODataModelBuilder builder = new ODataConventionModelBuilder();
builder.EntitySet<Product>("Products");
builder.EntitySet<Supplier>("Suppliers");

builder.Namespace = "ProductService";
builder.EntityType<Product>().Collection
    .Function("MostExpensive")
    .Returns<double>();
در اینجا یک متد function را به نام MostExpensive، بدون پارامتر و با نوع بازگشتی double، تعریف نموده‌ایم.

نکته:
 برای اینکه نوع بازگشتی از نوع EntitySet باشد:
ReturnsFromEntitySet<Product>("Products")
و یا نوع بازگشتی، لیستی از EntitySet‌ها باشد:
ReturnsCollectionFromEntitySet<Product>("Products");
و یا نوع بازگشتی بطور مثال لیستی از stringها باشد:
ReturnsCollection<string>();

برای فراخوانی این متد میتوان از آدرس زیر استفاده نمود:
GET http://localhost/Products/ProductService.MostExpensive

حال فقط کافیست که متد آن را در کنترلر مربوطه پیاده سازی نماییم:
public class ProductsController : ODataController
{
    [HttpGet]
    public IHttpActionResult MostExpensive()
    {
        var product = db.Products.Max(x => x.Price);
        return Ok(product);
    }

    // Other controller methods not shown.
}
اگر مقاله‌های قبلی را دنبال کرده باشید، این قسمت برای شما آشنا خواهد بود.
نوع response بازگشتی درخواست فوق چیزی شبیه به این خواهد بود:
HTTP/1.1 200 OK
Content-Type: application/json; odata.metadata=minimal; odata.streaming=true
OData-Version: 4.0
Date: Sat, 28 Jun 2016 00:44:07 GMT
Content-Length: 85

{
  "@odata.context":"http://localhost:38479/$metadata#Edm.Decimal","value":50.00
}

اضافه کردن Unbound Function
در مثال قبلی یک function bound نوشتیم که مربوط به یک EntitySet خاص بود. اما اکنون میخواهیم یک متد Unbound تعریف نماییم، به صورت زیر:
ODataModelBuilder builder = new ODataConventionModelBuilder();
builder.EntitySet<Product>("Products");

builder.Function("GetSalesTaxRate")
    .Returns<double>()
    .Parameter<int>("PostalCode");
توجه کنید اینجا ما متد را به صورت مستقیم از ODataModelBuilder تهیه نمود‌ه‌ایم؛ به جای Entity type یا collection مربوطه. این تنظیم به model builder میگوید که متدی unbound میباشد.
متد آن را نیز اینگونه پیاده سازی مینماییم:
[HttpGet]
[ODataRoute("GetSalesTaxRate(PostalCode={postalCode})")]
public IHttpActionResult GetSalesTaxRate([FromODataUri] int postalCode)
{
    double rate = 5.6;  // Use a fake number for the sample.
    return Ok(rate);
}
اهمیتی ندارد که این متد را در چه Controllerی پیاده سازی نمایید. ذکر [ODataRoute] نیز برای تعریف URl این function میباشد.

برای فراخوانی آن نیز از درخواست زیر استفاده مینماییم:
GET http://localhost/GetSalesTaxRate(PostalCode=10) HTTP/1.1
یک مثال از نوع response درخواست فوق
HTTP/1.1 200 OK
Content-Type: application/json; odata.metadata=minimal; odata.streaming=true
OData-Version: 4.0
Date: Sat, 28 Jun 2016 01:05:32 GMT
Content-Length: 82

{
  "@odata.context":"http://localhost:38479/$metadata#Edm.Double","value":5.6
}

شاید سؤالی برایتان پیش بیاید که آیا برای تعریف هر متد، این همه مراحل کانفیگ لازم است؟! در واقع باید عرض کنم، این نوع استفاده از OData، ابتدایی‌ترین نوع طراحی آن میباشد و قطعا در یک برنامه‌ی واقعی این همه کد نویسی برای نوشتن فقط یک متد، شاید منطقی به نظر نمیرسد. از آنجاییکه این مقاله فقط جنبه‌ی آموزشی خیلی ساده از این پروتکل را دارد، فعلا به همین اندازه بسنده میکنیم. اما در مقاله‌های بعدی راه‌حل‌هایی برای بینهایت ساده کردن کانفیگ OData را شرح خواهیم داد.
مطالب
Microsoft® SQL Server® 2012

نگارش نهایی Microsoft® SQL Server® 2012 چند روزی هست که ارائه شده. فعلا نسخه آزمایشی RTM آن در اختیار عموم است.
در ادامه جمع آوری لینک‌های مرتبط به این ارائه را مشاهده خواهید نمود:


و یک جدول مقایسه‌ای بین امکانات نگارش‌های رایگان SQL Server 2012 در اینجا

مطالب
مجموعه آموزشی رایگان workflow foundation از مایکروسافت
Intro to Windows Workflow Foundation (Part 1 of 7): Workflow in Windows Applications (Level 100)
This webcast is a code-focused introduction to developing workflow-enabled Microsoft Windows platform applications. We cover the basics of developing, designing, and debugging workflow solutions. Gain the knowledge and insight you need to be confident choosing workflow for everyday applications.


Intro to Windows Workflow Foundation (Part 2 of 7): Simple Human Workflow Using E-mail (Level 200)
Have you thought about how you might apply the workflow concept to e-mail? In this webcast New Zealand based regional director, Chris Auld, leads attendees through a simple worked example of the use of SMTP e-mail as part of a workflow solution. Chris demonstrates how to create custom activities to query Active Directory to retrieve user data, send e-mail, and wait for e-mail responses to continue the workflow process. This code-intensive session gives users taking their first steps with workflow a good grounding in some of the key extensibility concepts.


Intro to Windows Workflow Foundation (Part 3 of 7): Hosting and Communications Options in Workflow Scenarios (Level 300)
The session looks at options for hosting workflow applications. We cover managing events, instance tracking, and persistence, and provide a close look at the simple communications mechanisms that are available for you to use in your workflow applications.


Intro to Windows Workflow Foundation (Part 4 of 7): Workflow, Messaging, and Services: Developing Distributed Applications with Workflows (Level 300)
Web service technologies have typically taken a "do-it-yourself" approach to maintaining the interoperation state of services. Using workflow, developers now have tools that allow them to describe the long-running state of their services and delegate much of the state management to the underlying platform. Managing this state correctly becomes even more challenging in applications that coordinate work across multiple services either within an organization or at an Internet scale. This session looks at how developers who use either Microsoft ASMX or Microsoft's framework for building service-oriented applications, code-named "Indigo", can create workflow-oriented applications that are both faster to write and more manageable and flexible once deployed.


Intro to Windows Workflow Foundation (Part 5 of 7): Developing Event Driven State Machine Workflows (Level 300)
State machines used to be something that you had to first draw on paper and then implement in code. This session shows how to use technologies to create event-driven workflows and how to apply this to a typical programming problem. We introduce the concept of a flexible process and show how this can help with modeling real-world processes using state and sequential workflow. Plenty of coding is included to illustrate how you can seamlessly merge state machine design and your code.


Intro to Windows Workflow Foundation (Part 6 of 7): Extending Workflow Capabilities with Custom Activities (Level 300)
It is helpful to think of activities as controls within a workflow, similar to controls used with Microsoft ASP.NET Pages or Microsoft Windows Forms. You can use activities to encapsulate execution logic, communicate with the host and decompose a workflow into reusable components. This session examines the simple process of creating custom activities. If you want to expose activities to other developers designing workflows, you are likely to find this session valuable.


Intro to Windows Workflow Foundation (Part 7 of 7): Developing Rules Driven Workflows (Level 300)
Rules can be a powerful business tool when combined with workflow. In this session, learn how to develop more advanced activities that support the modeling of rich business behavior such as human workflow. Understand when to use rules for business logic, and see how rule policies allow for the description of sophisticated behavior in an integrated and flexible way. This session gives you an interesting insight into the power of using workflow at the core of a line of business application.
پاسخ به بازخورد‌های پروژه‌ها
خطا و راهنمایی
جناب نصیری بابت راهنمایی تشکر می‌کنم مشکلات فوق برطرف شد اما یه سری دیگه از خطاها بوجود اومد به شرح زیر لطفا مجددا راهنمایی بفرمائید
خطای زیر در فایل xaml درست عنوان شده اما ...
Error1Cannot create an instance of "Browser"....\Samples\DemosBrowser\MainWindow.xaml99DemosBrowser
Could not find a part of the path 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Pdf\AccountingBalanceSample.pdf'.

   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)

   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)

   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)

   at PdfRpt.FluentInterface.DataTemplate.get_PdfStreamOutput() in ...\Lib\FluentInterface\DataTemplate.cs:line 605

   at PdfRpt.PdfReportDocument.createPdf() in ...\Lib\PdfReportDocument.cs:line 119

   at PdfRpt.PdfReportDocument.<runInReleaseMode>b__0(Document pdfDisposable) in ...\Lib\PdfReportDocument.cs:line 113

   at PdfRpt.Core.Helper.Guard.SafeUsingBlock[TDisposable,T](TDisposable disposable, Action`1 action, Func`2 unwrapper) in ...\Lib\Core\Helper\Guard.cs:line 91

   at PdfRpt.Core.Helper.Guard.SafeUsingBlock[TDisposable](TDisposable disposable, Action`1 action) in ...\Lib\Core\Helper\Guard.cs:line 58

   at PdfRpt.PdfReportDocument.runInReleaseMode() in ...\Lib\PdfReportDocument.cs:line 105

   at PdfRpt.PdfReportDocument.GeneratePdf(Boolean debugMode) in ...\Lib\PdfReportDocument.cs:line 87

   at PdfRpt.FluentInterface.PdfReport.Generate(Action`1 pdfRptFileBuilder, Boolean debugMode) in ...\Lib\FluentInterface\PdfReport.cs:line 90

   at PdfReportSamples.AccountingBalanceColumn.AccountingBalanceColumnPdfReport.CreatePdfReport() in ...\Samples\PdfReportSamples\AccountingBalanceColumn\AccountingBalanceColumnPdfReport.cs:line 17
ارجاع به dllهای زیر درست است اما..
Warning4Could not resolve this reference. Could not locate the assembly "System.Windows.Controls.Toolkit, Version=4.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.SlPdf
Warning5Could not resolve this reference. Could not locate the assembly "System.Windows.Controls.Toolkit.Internals, Version=4.0.5.0, Culture=neutral, PublicKeyToken=2c5c654d367bf4a7". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.SlPdf
Error1The type or namespace name 'BusyIndicator' could not be found (are you missing a using directive or an assembly reference?)...\Samples\SlPdf\SlPdf\obj\Debug\MainPage.g.i.cs3818SlPdf
Warning2The variable 'ex' is declared but never used...\Samples\DemosBrowser\Converters\ShellThumbnailConverter.cs4030DemosBrowser
با تشکر