نظرات مطالب
سفارشی سازی ASP.NET Core Identity - قسمت پنجم - سیاست‌های دسترسی پویا
با تشکر. متوجه این مورد شدم، منظورم بیشتر ساختار Entity موردنیاز در بانک اطلاعاتی است چون در CookieAuthentication جداول بصورت دلخواه ساخته میشوند. اگر به این شکل ساخته شود و داده‌ها هم به این شکل وارد شوند صحیح است؟

و سوال دیگری که ذهنم را درگیر کرده بود، آیا در متد CreateCookieClaimsAsync ، مقادیر ClaimTypeها نیز باید مانند Role‌های کاربر در یک حلقه وارد سیستم ClaimsIdentity شوند؟ 
نظرات مطالب
آشنایی با آزمایش واحد (unit testing) در دات نت، قسمت 4
- در NHibernate برای این نوع تست‌ها تا جایی که دیدم از دیتابیس SQLite تشکیل شده در حافظه استفاده می‌کنند. به این صورت مزایای سرعت و همچنین حذف خودکار داده‌ها پس از پایان کار برقرار است.
- ضمناآزمایش واحدی که از مرزهای برنامه خارج شود دیگر آزمایش واحد نام ندارد به همین جهت mocking frameworks برای این نوع کارها ایجاد شده است. (برای کار با دیتابیس، کار با smtp server ، کار با فایل سیستم و مواردی از این دست)
بازخوردهای پروژه‌ها
خطای sql?
ببخشید برای بازخورد قبلیم جایی برای ویرایش پیدا نکرم.
کد کامل کلاس من به این صورته:
 class SQLiteDataReaderPdfReport
    {
        public IPdfReportData CreatePdfReport()
        {
           
                return new PdfReport().DocumentPreferences(doc =>
                {
                    doc.RunDirection(PdfRunDirection.RightToLeft);
                    doc.Orientation(PageOrientation.Portrait);
                    doc.PageSize(PdfPageSize.A4);
                    doc.DocumentMetadata(new DocumentMetadata { Author = "Vahid", Application = "PdfRpt", Keywords = "Test", Subject = "Test Rpt", Title = "Test" });
                })
                .DefaultFonts(fonts =>
                {
                    fonts.Path(System.AppDomain.CurrentDomain.BaseDirectory + "\\fonts\\BMitra.ttf",
                                      Environment.GetEnvironmentVariable("SystemRoot") + "\\fonts\\verdana.ttf");
                })
                .PagesFooter(footer =>
                {
                    footer.DefaultFooter(DateTime.Now.ToString("MM/dd/yyyy"));
                })
                .PagesHeader(header =>
                {
                    header.DefaultHeader(defaultHeader =>
                    {
                        defaultHeader.RunDirection(PdfRunDirection.RightToLeft);
                        defaultHeader.ImagePath(System.AppDomain.CurrentDomain.BaseDirectory + "\\Images\\s.jpg");
                        defaultHeader.Message("لیست دانشجویان");
                    });
                })
                .MainTableTemplate(template =>
                {
                    template.BasicTemplate(BasicTemplate.SilverTemplate);
                })
                .MainTablePreferences(table =>
                {
                    table.ColumnsWidthsType(TableColumnWidthType.Relative);
                    table.NumberOfDataRowsPerPage(5);
                })
                .MainTableDataSource(dataSource =>
                {
                    dataSource.GenericDataReader(
                        providerName: "System.Data.SQLite",
                        connectionString: "Data Source=" + System.AppDomain.CurrentDomain.BaseDirectory + "\\data\\database.sqlite",
                        sql: @"SELECT id,name,family,mark
                               FROM Student
                                WHERE id='1'",
                             

                        parametersValues: new object[] { 10 }
                    );
                })

                .MainTableColumns(columns =>
                {
                    columns.AddColumn(column =>
                    {
                        column.PropertyName("id");
                        column.IsRowNumber(true);
                        column.CellsHorizontalAlignment(HorizontalAlignment.Center);
                        column.IsVisible(true);
                        column.Order(0);
                        column.Width(2);
                        column.HeaderCell("کد");
                    });


                    columns.AddColumn(column =>
                    {
                        column.PropertyName("name");
                        column.CellsHorizontalAlignment(HorizontalAlignment.Center);
                        column.IsVisible(true);
                        column.Order(1);
                        column.Width(2);
                        column.HeaderCell("نام");
                    });

                    columns.AddColumn(column =>
                    {
                        column.PropertyName("family");
                        column.CellsHorizontalAlignment(HorizontalAlignment.Center);
                        column.IsVisible(true);
                        column.Order(2);
                        column.Width(2);
                        column.HeaderCell("نام خانوادگی");
                    });

                    columns.AddColumn(column =>
                    {
                        column.PropertyName("mark");
                        column.CellsHorizontalAlignment(HorizontalAlignment.Center);
                        column.IsVisible(true);
                        column.Order(3);
                        column.Width(2);
                        column.HeaderCell("نمره");
                    });
                })
                .MainTableEvents(events =>
                {
                    events.DataSourceIsEmpty(message: "There is no data available to display.");
                })
                .Export(export =>
                {
                    export.ToExcel();
                })
                .Generate(data => data.AsPdfFile(System.AppDomain.CurrentDomain.BaseDirectory + "\\Pdf\\RptSqlDataReaderSample.pdf"));
           
        }
        
    }
}
به خاطر توجهی که کردید سپاسگزارم!
مطالب
مجموعه آموزشی رایگان 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.
اشتراک‌ها
QuickChart، ایجاد نمودارهای تصویری.

Static embeddable image charts for email, SMS, reports, and more 

<img src="https://quickchart.io/chart?width=500&height=300&c={type:'bar',data:{labels:['January','February','March','April', 'May'], datasets:[{label:'Dogs',data:[50,60,70,180,190]},{label:'Cats',data:[100,200,300,400,500]}]}}">


QuickChart، ایجاد نمودارهای تصویری.
نظرات مطالب
jQuery Ajax و نحوه صحیح ارسال مقادیر به یک وب سرویس
من کد زیر رو ارسال می‌کنم ولی مشکلی که وجود داره این هست که نه پارمترها ارسال میشه و نه درخواست آژاکسی هست.صفحه رو واقعا هدایت میکنه به آدرس مورد نظر.
//new group
    $("#NewGroup").on('click', function () {
        var catName = 'new';// $("#appendNodeText").val();
        $.ajax({
            dataType: "json",
            type: "POST",
            url: "@Url.Action(MVC.Categories.NewCategory())",
            data: { name: catName }

        }).done(function (data) {
            alert(data);
        });
    });
نظرات مطالب
ASP.NET MVC #18
یک متد الحاقی است به این شکل:
        public static int ToInt(this string data)
        {
            if (string.IsNullOrWhiteSpace(data)) return 0;
            int result;
            return int.TryParse(data, out result) ? result : 0;
        }
فقط هنگام لاگین، به userName خود id کاربر انتساب داده شده:
FormsAuthentication.SetAuthCookie(user.Id.ToString(CultureInfo.InvariantCulture), ...
// ...
FormsAuthentication.RedirectFromLoginPage(user.Id.ToString(CultureInfo.InvariantCulture), ...
اشتراک‌ها
Git را از نزدیک ببینید!

همه برنامه نویسان حرفه ای از یکی از سیستم‌های مدیریت کد استفاده می‌کنند. Git هم یکی از آنهاست ولی برای من دوست داشتنی‌ترین آنهاست. برای درک بهتر عملکرد سیستم مدیریت کد Git، بد نیست نگاهی  کلی به عملیات آن داشته باشیم. در این سایت با اجرای دستورات، وضعیت مخزن کد به تصویر کشیده می‌شود.

Git را از نزدیک ببینید!