entity-framework

Need help debugging: Having trouble getting data to Silverlight App through RIA Services, Entity Framework, MySQL

左心房为你撑大大i 提交于 2020-01-06 07:12:25
问题 I'm trying to build a Silverlight App that accesses and presents data from a MySQL database. I'm trying to use Entity Framework to model the MySQL data and RIA Services to make the data via EF available to Silverlight. My Silverlight App is showing the correct columns in the datagrid, but it does not show the data (alternate link to image) : When I look at the DomainService file (used for RIA Services), I see this: public IQueryable<saw_order> GetSaw_order(int intOrder) { return this.Context

Can Entity Framework be used when relational data is missing?

本秂侑毒 提交于 2020-01-06 07:00:12
问题 I am creating a web site, and the data will be sent in from an external application that has a database full of data, only parts of which are needed for the web site. By "parts" I mean some of the rows in each table, but not all of them. The business in hand is one that manages charity vouchers, and they have customers who have accounts with them. Charities may want to log in to the web site and see info about money paid to them, and customers may want to log in and see info about their

Can Entity Framework be used when relational data is missing?

徘徊边缘 提交于 2020-01-06 07:00:11
问题 I am creating a web site, and the data will be sent in from an external application that has a database full of data, only parts of which are needed for the web site. By "parts" I mean some of the rows in each table, but not all of them. The business in hand is one that manages charity vouchers, and they have customers who have accounts with them. Charities may want to log in to the web site and see info about money paid to them, and customers may want to log in and see info about their

SQL Server Tokencache issue

99封情书 提交于 2020-01-06 06:57:08
问题 I basically took code from here https://github.com/Azure-Samples/active-directory-dotnet-webapp-webapi-multitenant-openidconnect/blob/master/TodoListWebApp/DAL/EFADALTokenCache.cs but it is not suitable for my application as I don't need the cache per user as given in the example. Accordingly I removed the constructor that accepted User as a parameter since I wanted the cache to be global. I have came up with this version: public class EFTestTokenCache : TokenCache { private TestEntities

What should I pass from the controller to my view in ASP.NET MVC 4 with Entity Framework?

旧时模样 提交于 2020-01-06 06:52:38
问题 I am new to ASP.NET MVC and please help me rather than criticizing the question. I have a registration form which has 4 classes named form , country , state , city . The last three are for populating the cascading Dropdownlist in my form public partial class form { public int Id { get; set; } public string UniqueId { get; set; } public string Country{ get; set; } public string state { get; set; } public string city { get; set; } public Nullable<long> PinCode { get; set; } public Nullable<long

EntityFramework LINQ Order using string and nested reflection

怎甘沉沦 提交于 2020-01-06 06:30:37
问题 I saw already some of the similar questions, but cannot find an anwser how to solve this problem. I want to have a possibility to order collection using string as property name. Model: public sealed class User : IdentityUser { #region Constructors #endregion #region Properties [Required] [Display(Name = "First name")] public string FirstName { get; set; } [Required] [Display(Name = "Last name")] public string LastName { get; set; } [ForeignKey("Superior")] public string SuperiorId { get; set;

EntityFramework LINQ Order using string and nested reflection

别等时光非礼了梦想. 提交于 2020-01-06 06:29:39
问题 I saw already some of the similar questions, but cannot find an anwser how to solve this problem. I want to have a possibility to order collection using string as property name. Model: public sealed class User : IdentityUser { #region Constructors #endregion #region Properties [Required] [Display(Name = "First name")] public string FirstName { get; set; } [Required] [Display(Name = "Last name")] public string LastName { get; set; } [ForeignKey("Superior")] public string SuperiorId { get; set;

is it possible to make migrations simplified ?

不羁岁月 提交于 2020-01-06 06:04:15
问题 During development we did such things as create table, drop index, etc in our migrations (let say we have over hundreds migrations file). Now I want to deploy on production server, could I create simplified migration like in 1 file to summary all of the changes on my development ? to clarify I give example : migrations 1 - create table student migrations 2 - rename student_name to student_full_name migrations 3 - rename address to student_address now I want to have a better migration file

“An error occurred while updating the entries” in EF when I try to SaveChanges() to context

无人久伴 提交于 2020-01-06 06:01:17
问题 I've created two lists that corresponds to two of my classes: //Photo var photos = new List<Photo>{ new Photo { Title = "Title1", Description = "Description1", CreatedDate = DateTime.Today } }; //Comment var comments = new List<Comment> { new Comment{ PhotoId = 1, UserName = "User1", Subject = "Comment1", } }; When I tried to add these two lists to my context object and then SaveChanges, I got the error I mentioned: photos.ForEach(s => context.Photos.Add(s)); comments.ForEach(s => context

Error in Database.EnsureCreated() while using Entity Framework with Sqlite in Xamarin

允我心安 提交于 2020-01-06 05:56:23
问题 I'm using Entity Framework in Xamarin Forms that uses sqlite. When I debug Xamarin.Android , everything is ok, also in debugging Xamarin.iOs with iPhone simulator, it works fine. My DbContext is: public class DB:DbContext { // Tables private readonly string _databasepath; public DB(string databasepath) { _databasepath = databasepath; Database.EnsureCreated(); } protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { optionsBuilder.UseSqlite($"filename={_databasepath}")