یک نمونه در اینجا: «datepicker شمسی برای Angular Material»
می تونم rollback کنم به angular cli 1.7.4 ???
نظرات مطالب
Performance در AngularJS قدم اول
در نسخههای قدیمیتر نیز میتوانید از Angular bindonce استفاده کنید.
یکی از انواع روشهایی که در SQL Server و مشتقات آن برای نمایش رکوردها به صورت اتفاقی مورد استفاده قرار میگیرد، استفاده از کوئری زیر است:
سؤال: ترجمه و معادل کوئری فوق در Entity framework به چه صورتی است؟
پاسخ:
یک مثال کامل را در این زمینه در ادامه ملاحظه میکنید:
تنها نکته مهم آن سطر ذیل است که برای مرتب سازی اتفاقی استفاده شده است:
که معادل
در SQL Server است.
خروجی SQL تولیدی کوئری LINQ فوق را نیز در ادامه مشاهده میکنید:
SELECT * FROM table ORDER BY NEWID()
پاسخ:
یک مثال کامل را در این زمینه در ادامه ملاحظه میکنید:
using System; using System.Data.Entity; using System.Data.Entity.Migrations; using System.Linq; namespace Sample { public class User { public int Id { get; set; } public string Name { get; set; } public int Age { get; set; } } public class MyContext : DbContext { public DbSet<User> Users { get; set; } } public class Configuration : DbMigrationsConfiguration<MyContext> { public Configuration() { AutomaticMigrationsEnabled = true; AutomaticMigrationDataLossAllowed = true; } protected override void Seed(MyContext context) { context.Users.Add(new User { Name = "User 1", Age = 20 }); context.Users.Add(new User { Name = "User 2", Age = 25 }); context.Users.Add(new User { Name = "User 3", Age = 30 }); context.Users.Add(new User { Name = "User 4", Age = 35 }); context.Users.Add(new User { Name = "User 5", Age = 40 }); base.Seed(context); } } public static class Test { public static void RunTests() { Database.SetInitializer(new MigrateDatabaseToLatestVersion<MyContext, Configuration>()); using (var context = new MyContext()) { var randomListOfUsers = context.Users .Where(person => person.Age >= 25 && person.Age < 40) .OrderBy(person => Guid.NewGuid()) .ToList(); foreach (var person in randomListOfUsers) Console.WriteLine("{0}:{1}", person.Name, person.Age); } } } }
.OrderBy(person => Guid.NewGuid())
ORDER BY NEWID()
خروجی SQL تولیدی کوئری LINQ فوق را نیز در ادامه مشاهده میکنید:
SELECT [Project1].[Id] AS [Id], [Project1].[Name] AS [Name], [Project1].[Age] AS [Age] FROM ( SELECT NEWID() AS [C1], ------ Guid created here [Extent1].[Id] AS [Id], [Extent1].[Name] AS [Name], [Extent1].[Age] AS [Age] FROM [dbo].[Users] AS [Extent1] WHERE ([Extent1].[Age] >= 25) AND ([Extent1].[Age] < 40) ) AS [Project1] ORDER BY [Project1].[C1] ASC ------ Used for sorting here
اشتراکها
شروع کار با gRPC در Asp.net core
اشتراکها
شروع کار با gRPC
اشتراکها
آزمایش کنترلر ها در Asp.net core
اشتراکها