1

I want to migrate my project from Code Fluent to entity Framework. and i have a problem with some functions in the login controller

 public static System.Data.DataSet GetSpaces(System.Guid userId)
    {
        if ((userId.Equals(CodeFluentPersistence.DefaultGuidValue) == true))
        {
            throw new System.ArgumentNullException("userId");
        }
        System.Data.DataSet ret = default(System.Data.DataSet);
        CodeFluent.Runtime.CodeFluentPersistence persistence = CodeFluentContext.Get(Erpeo.Store.Model.Constants.Erpeo_Store_ModelStoreName).Persistence;
        persistence.CreateStoredProcedureCommand(null, "User", "GetSpaces");
        persistence.AddParameter("@userId", userId);
        System.Data.IDataReader reader = null;
        try
        {
            reader = persistence.ExecuteReader();
            if ((reader.Read() == true))
            {
                ret = CodeFluent.Runtime.CodeFluentPersistence.LoadDataSet(reader);
            }
        }
        finally
        {
            if ((reader != null))
            {
                reader.Dispose();
            }
            persistence.CompleteCommand();
        }
        return ret;
    }

and then they used thet getspace function like that

var user = Entities.User.LoadById(userId);
        var dataset = Entities.User.GetSpaces(userId);

        if (dataset.Tables[0] != null)
        {
            var groupBySubscriber = dataset.Tables[0].IEnumerable().GroupBy(r => r["Subscriber_Id"]);

Any advice from one who encountered this problem?

zarzou
  • 113
  • 14
  • What is the problem with the login controller? It could be useful to post some code. – meziantou Sep 20 '19 at 17:25
  • this line using (var persistence = new ErpeoStoreEntities()) { ret = persistence.User.SqlQuery("GetSpaces", userId).ToArrayAsync().Result; //FromSql("GetSpaces", userId).ToArrayAsync().Result; } – zarzou Sep 24 '19 at 11:03
  • You should [edit] your question to include the code and the error you are getting. It would be preferable to post a [mre] so that others could possible reproduce the issue. – Heretic Monkey Sep 24 '19 at 14:17
  • @HereticMonkey done – zarzou Sep 24 '19 at 14:35

0 Answers0