VSCode برای توسعه دهندگان سیشارپ
VSCode for the C# Developer - Tim Corey - NDC London 2023
VSCode is a nimble editor that can do just about anything. In this session, we will set up and configure VSCode for use in C# development. Then we will use it to build, debug, and deploy a small .NET Core web application to Azure.
Along the way, we will go over a list of the top C#-focused plugins for VSCode. Whether you are just getting started with VSCode or you are used to VSCode but want to start building C# projects, this session will get you up to speed fast.
using Microsoft.Data.Entity; using Microsoft.Data.Entity.Metadata; using System.Collections.Generic; using System.Linq; namespace UsingEF7WithSQLite { public class Blog { public int BlogId { get; set; } public string Url { get; set; } public List<Post> Posts { get; set; } } public class Post { public int PostId { get; set; } public string Title { get; set; } public string Content { get; set; } public int BlogId { get; set; } public Blog Blog { get; set; } } }
PM> Install-Package EntityFramework.SQLite –Pre
namespace UsingEF7SQLiteProvider { public class BloggingContext : DbContext { public DbSet<Blog> Blogs { get; set; } public DbSet<Post> Posts { get; set; } protected override void OnConfiguring(DbContextOptions builder) { builder.UseSQLite(@"Data Source=.\BloggingDatabae.db"); } protected override void OnModelCreating(ModelBuilder builder) { builder.Entity<Blog>() .OneToMany(b => b.Posts, p => p.Blog) .ForeignKey(p => p.BlogId); // The EF7 SQLite provider currently doesn't support generated values // so setting the keys to be generated from developer code builder.Entity<Blog>() .Property(b => b.BlogId) .GenerateValueOnAdd(false); builder.Entity<Post>() .Property(b => b.BlogId) .GenerateValueOnAdd(false); } } }
Install-Package EntityFramework.Commands -Pre
Add-Migration MyFirstMigration Apply-Migration
using (var db = new BloggingContext()) { db.Database.AsMigrationsEnabled().ApplyMigrations(); }
using (var db = new Models.BloggingContext()) { db.Blogs.Add(new Models.Blog { Url = "https://www.dntips.ir" }); db.SaveChanges(); foreach (var item in db.Blogs) { Console.WriteLine(item.Url); } } Console.ReadLine();
ASP.NET Core 3.0 Preview 3 منتشر شد
We finished week 2 of the 9-week boot camp. This week was AngularJS week. We covered building the front-end of a Single Page App with the AngularJS framework. In particular, we covered topics such as client-side routing, making Ajax calls using the $http service and the $route factory, building custom AngularJS services, working with Google Maps, using Angular UI Bootstrap, and uploading files to services such as FilePicker.io.
انتشار نسخه اول پیشنمایش داتنت ۸
Welcome to .NET 8! The first preview is ready for you to download: claim your copy of the first .NET 8 preview and start building applications today. Scroll down to see the list of features included in this preview. .NET 8 is a long-term support (LTS) release. This blog post covers the major themes and goals that drive the prioritization and selection of enhancements to develop. .NET 8 preview and release candidate builds will be delivered monthly. As usual, the final release will be delivered sometime in November at .NET Conf.