how to get employee using optimal way by id,name ,exp - c#

i have written below code without applying any design pattern,Is anything wrong in this code.
class Employee {
public int EmployeeID
{ get; set; }
public int YearOExperience
{ get; set; }
public int Salary
{ get; set; }
public string EmploeyeeType
{ get; set; }
}
interface IEmployee {
List<Employee> getInformation(int id, int exp, int sal);
}
class EmployeeData1 {
public List<Employee> GetData(int id,int exp , int sal)
{
List<Employee> empInfo = new List<Employee> {
new Employee { EmploeyeeType = "P", EmployeeID = 1, Salary = 20000, YearOExperience= 2 },
new Employee { EmploeyeeType = "P", EmployeeID = 2, Salary = 20000, YearOExperience= 2 },
new Employee { EmploeyeeType = "C", EmployeeID = 3, Salary = 20000, YearOExperience= 2 }
};
return empInfo;
}
}
static void Main(string[] args) {EmployeeData1 emp = new EmployeeData1();
emp.getInformation(1, 2, 2000);
};
}
Here is the assignment:

Since you pasted the image instead of text, we have to pay for it by re-typing.
Do not handover like this. Instead of trying to employ design patterns (which is not expected from you), handover work which is correct.
Your assignment says that you should take as input the employee name, employee type and years of experience.
Your console app should get these three values by Console.ReadLine() commands.
Please make sure that this is so. Bu it probably is, since all the code competitions use stdin (Console.ReadLine() reads from stdin) to feed input to an application.
Then, what your teacher wants from you are:
Generate a sequential employee Id,
Calculate the salary according to the years of experience
Print out the results (using Console.WriteLine(), which writes to the stdout (standard output))
Proceed to the next employee
Here is a limited example to help you. Please do research and fill in the required parts yourself, otherwise, what does it mean to get a good mark if it isn't yours?
I am not saying that you can handover this directly, mind you.
But at least you can take this as a starting point.
Good luck.
static void Main()
{
// this will be used to create sequential employee Ids
int employeeId = 0;
while(true) // Just press enter without entering anything to exit.
{
string employeeName = Console.ReadLine();
if(employeeName == "")
{
return;
}
// Get the other two input parameters like the one above.
// Please be careful with the last one (years of experience)
// It should be parsed to an integer (a little research effort)
// string employeeType = ..
// int yearsOfExperience = ..
// Now, assign this employee the next Id.
employeeId++;
// And now, calculate the employee's salary
// You should use the years of experience and employee type
// to match an amount in the salary table.
int salary;
if(employeeType == "Permanent")
{
salary = ..;
}
else
{
salary = ..;
}
// And finally, print-out using stdout
Console.WriteLine("Employee ID: {0}", employeeId);
// Print the other two outputs like the one above
}
}

Related

Creating multiple inputs to a ClassList

So I have coded for a while I C# and learned the basics, one thing that always stops me is how I can create a class and then use a list for a user to input values.
I don't know if I'm totally off the chart with this code, the problem is that I don't understand why I can't use my newly created object of the class and add input to it. All help is appreciated
class Program
{
static void Main(string[] args)
{
List<Citizen> listOfCitizens = new List<Citizen>();
for (int i = 0; i < listOfCitizens.Count; i++)
{
Console.WriteLine("Enter Surname for the citizen:");
listOfCitizens.SurName.add = Console.ReadLine();
Console.WriteLine("Enter Lastname for the citizen:");
listOfCitizens.Lastname.add = Console.ReadLine();
Console.WriteLine("Enter age of the citizen:");
listOfCitizens.age.add = int.Parse(Console.ReadLine());
}
Console.WriteLine($"Name {Citizen.SurName} {Citizen.LastName} {Citizen.age}");
Console.Read();
}
}
class Citizen
{
public static string SurName{ get; set; }
public static string LastName{get;set;}
public static int age { get; set; }
}
A list of something is not a something. Just like a basket of apples is not an apple. You don't eat the basket, you eat an item from the basket.
So when you create your list:
List<Citizen> listOfCitizens = new List<Citizen>();
You would then create an item to add to the list:
Citizen someCitizen = new Citizen();
someCitizen.SurName = "Smith";
// etc.
And then add it to the list:
listOfCitizens.Add(someCitizen);
Additionally, your Citizen is a little off. Those properties shouldn't be static. Not sure why you made them that way, but you should remove the static keyword from everything in your Citizen class.

C# : Using struct , List and enum; format exception

I have enum called Department that has abbreviations. (e.g. CSIS, ECON etc.)
I have struct Course with fields name, number of the course(e.g. 101 Fundamentals Of Computing just the number)
I created the constructor with four parameters.
In Program cs I created the List of these courses. with the order of (name(which is string), Department(I got this through calling Department type in enum), CourseCode(enum members like CSIS)and credit hours).
I was required to print all the courses through toString().
public string Name
{
get { return name; }
set { name = value; }
}
public int Number
{
get { return number; }
set { number = value; }
}
public int CreditHours
{
get { return numOfCreditHours; }
set { numOfCreditHours = value; }
}
public override string ToString()
{
return String.Format("{ -30, 0}--{4, 1}/{2}--{3:0.0#}", name, Department, number, numOfCreditHours);
}
This is where I created my List: in Program cs.
static void Main(string[] args)
{
Course course = new Course(courses);
foreach (Course crs in courses)
{
Console.WriteLine(string.Join(" , ", crs));
}
Console.WriteLine();
//Array.Sort(courses);
Console.ReadLine();
}
private static List<Course> courses = new List<Course>()
{
new Course("Fundamentals of Programming", Department.CSIS, 1400, 4),
new Course("Intermediate Programming in C#", Department.CSIS,2530, 3),
new Course("Introduction to Marketing", Department.MKTG,1010, 3),
new Course("Algorithms and Data Structures", Department.CSIS,2420, 4),
new Course("Object Oriented Programming", Department.CSIS, 1410, 4)
};
I get format exception. I know why I get it. Because of string type. but some how I need to do it. Please help me with some explaining. and what I should do to get it right. Thanks.
it looks like you swapped places in string format:
return String.Format("{0,-30}--{1,4}/{2}---{3:0.0#}"
You're confusing indexes in the format string in "{ -30, 0}--{4, 1}/{2}--{3:0.0#}".
"{ -30, 0}" must be "{0, -30}".
"{4, 1}" must be "{1, 4}".
Then, returns must be:
return String.Format("{0,-30}--{1,4}/{2}--{3:0.0#}", name, Department, number, numOfCreditHours);

Verifying multiple product's features added in the cart is same in the Order Summary page with Selenium webdriver + Specflow + C#+ page object pattern

I have added 2 products in my basket. in the first step of my Test.
In the last step I assert that same product that were added in the first step of the test comes in the Last step which is the "Order Summary page". Please find below the code and screen shots.
Here there are 2 items, all the features of the 2 items displayed have same classes. just the indexing of the div is different. rest is the same.
I am using the Scenario Context functionality of the Specflow.
Mindwell, i want to achieve like this image , i have code currently for only 1 product, and i want to do the same for multiple products.
1) Basketpage. In this step i take all the elements of the page and take their values in the scenario context.
string productname = pdpPage.getBrandName();
pdpPage.ExpandSideBar();
pdpPage.SelectProductQuantity(Quantity);
var hp = new HeaderPage(driver);
int currentBagQuantity = hp.getBagQuantity();
decimal currentTotalBagPrice = hp.getBagTotalPrice();
ScenarioContext.Current.Add("Product Name",productname);
ScenarioContext.Current.Add("QuantityAdded", int.Parse(Quantity));
ScenarioContext.Current.Add("BagQuantity", currentBagQuantity);
ScenarioContext.Current.Add("CurrentBagPrice", currentTotalBagPrice);
ScenarioContext.Current.Add("ProductPrice", pdpPage.getProductPriceInDecimal());
2) OrderSummary Page. In this step i assert the values , This is the order summary page.
var os = new OrderSummaryPage(driver);
string brandname = os.getOrderProductName();
int quantity = os.getOrderQuantity();
decimal price = os.getOrderPrice();
Assert.IsTrue(brandname.Equals((string)ScenarioContext.Current["Product Name"]), "Err! Product is different!, on pdp is :" + ScenarioContext.Current["Product Name"] + "on order summary is" + brandname);
Assert.IsTrue(quantity.Equals((int)ScenarioContext.Current["QuantityAdded"]), "Err! Quantity is different from ordered!");
Assert.IsTrue(price.Equals((decimal)ScenarioContext.Current["ProductPrice"]), "Err! Product price is appearing to be different!");
Assert.IsTrue(GenericFunctions.isElementPresent(os.Delivery_Address), "Delivery Address details are not present");
Assert.IsTrue(GenericFunctions.isElementPresent(os.Billing_Address), "Billing Address details are not present!!");
I am new to this stuff!! How to loop these and get the dynamic stuff. I want to check and verify each items Product name , price , quantity.
Doing this :
My Step File :
[When(#"I check the items on basket page")]
public void WhenICheckTheItemsOnBasketPage()
{
var bp = new BasketPage(driver);
var h = bp.getLISTItemsFromOrderPage();
for (int i = 0; i <= h.Count; i++)
{
ScenarioContext.Current.Add("item", h[i]);
}
}
BasketPage.cs
public IList getLISTItemsFromOrderPage()
{
List<BasketItems> orderProducts = new List<BasketItems>();
var elements = (driver.FindElements(By.Id("basketitem")));
foreach (IWebElement element in elements)
{
orderProducts.Add(CreateOrderProduct(element));
}
return orderProducts;
}
public BasketItems CreateOrderProduct(IWebElement item)
{
return new BasketItems()
{
BrandName = item.FindElement(By.TagName("a")).Text.Trim(),
Quantity = GenericFunctions.DropDown_GetCurrentValue(item.FindElement(By.TagName("select"))),
Price = Convert.ToDecimal(item.FindElement(By.ClassName("col-md-2")).Text.Substring(1))
};
}
BasketItem.cs
public class BasketItems : BasketPageOR
{
public string BrandName { get; set; }
public string Quantity { get; set; }
public decimal Price { get; set; }
}
Please Help! Thanks in Advance!!
you method os.getOrderProductName(); doesn't make any sense if an order can have multiple products.
You should have a method os.getOrderProducts(); which will return a collection of OrderProduct objects. It should do this by finding all elements which have an id="productorderelement" (although you should not have elements with the same id, you should really use a class for this) and then loop over each element extracting the information to build the OrderProduct soemthing like this should allow you to get the elements with the id:
List<OrderProduct> orderProducts = new List<OrderProduct>();
var elements = (Driver.FindElements(By.XPath("//*[#id=\"productorderelement\"]")))
foreach (element in elements)
{
orderProducts.Add(CreateOrderProduct(element));
}
public class OrderProduct
{
public string BrandName{get;set;}
public int Quantity{get;set;}
public double Price{get;set;}
}
public OrderProduct CreateOrderProduct(IWebElement element)
{
return new OrderProduct()
{
BrandName= element.Something, //you need to extract the appropriate bit of the webelement that holds the brandname, quantity and price, but you don't show us the structure so I can't help there
Quantity= element.FindElement(By.Class("quantity")).Text, //for example
Price= element.GetAttribute("Price") //again another example
}
}

How to Deserialize a JSON array in List (C#)

I am struggling with a subject that has a lot of variants in this forum but I can't seem to find one that suits me, and I think it's because of the way that my JSON array is :(
I'm not an expert but I already manage to "almost" get the end...
I need to get hand in "Success" and "Status" value. But also the different "Addresses".
My JSON (is called responseFromServer):
{
"success":true,
"addresses":
[
{"DPID":658584,"SourceDesc":"Postal\\Physical","FullAddress":"1/8 Jonas Street, Waimataitai, Timaru 7910"},
{"DPID":658585,"SourceDesc":"Postal\\Physical","FullAddress":"2/8 Jonas Street, Waimataitai, Timaru 7910"},
{"DPID":658583,"SourceDesc":"Postal\\Physical","FullAddress":"3/8 Jonas Street, Waimataitai, Timaru 7910"}
],
"status":"success"
}
Then, based on lot of examples in this forum, taking bits and pieces I created my classes:
public class jsonDataTable
{
public bool success { get; set; }
public IEnumerable<dtaddresses> addresses { get; set; }
public string status { get; set; }
}
public class dtaddresses
{
public int DPID { get; set; }
public string SourceDesc { get; set; }
public string FullAddress { get; set; }
}
Then I'm going to Deserialize:
public void _form_OnCallingAction(object sender, ActionEventArgs e)
{
...
...
JavaScriptSerializer js = new JavaScriptSerializer();
jsonDataTable jsonArray = js.Deserialize<jsonDataTable>(responseFromServer);
...
string tb = jsonArray.status.ToString();
string tb2 = jsonArray.success.ToString();
...
...
List<dtaddresses> _listAddresses = new List<dtaddresses>
{
new dtaddresses()
};
...
...
try
{
string tb3 = _listAddresses.Count.ToString();
string tb4 = _listAddresses[0].FullAddress;
}
catch (Exception ex)
{
CurrentContext.Message.Display(ex.Message + ex.StackTrace);
}
...
...
...
CurrentContext.Message.Display("Raw Response from server is: {0}", responseFromServer);
//Returns all the content in a string to check. OK! :)
CurrentContext.Message.Display("The success value is: {0} ", tb);
//Returns the Status Value (in this case "success") OK! :)
CurrentContext.Message.Display("The status value is: {0} ", tb2);
//Returns the Success Value (in this case "true") giggity giggity! All Right! :)
CurrentContext.Message.Display("The n. of addresses is: {0} ", tb3);
//Returns how many addresses ( in this case is returning 0) not ok... :(
CurrentContext.Message.Display("The address value is: {0} ", tb4);
// Returns the Fulladdress in index 0 (in this case nothing...) not ok... :(
Can any one help me to understand why I can access the values in the "dtaddresses" class?
This is the far that I went...
The following piece of code I copied from your question is creating a brand new list that has nothing to do with your deserialized data. Thus it's always going to be a single element list, where the first element contains only default values, which is what you are seeing in tb3 and tb4 later on.
List<dtaddresses> _listAddresses = new List<dtaddresses>
{
new dtaddresses()
};
Instead, assign jsonArray.addresses to _listAddresses, such as:
List<dtaddresses> _listAddresses = jsonArray.addresses.ToList()
Or you can forget about _listAddresses completely, and just simply reference jsonArray.addresses directly, such as:
string tb3 = jsonArray.addresses.Count().ToString();
string tb4 = jsonArray.addresses.First().FullAddress;

Subsonic one to many relationship child objects

I don't know if I am doing something wrong "I think I am" or I have hit a subsonic limitation.
I have 3 tables Articles, ArticleCategories and ArticleComments with a one to many relationship between Articles the other tables.
I have created the following class
public partial class Article
{
private string _CategoryName;
public string CategoryName
{
get { return _CategoryName; }
set
{
_CategoryName = value;
}
}
public ArticleCategory Category { get;set;}
private List<System.Linq.IQueryable<ArticleComment>> _Comments;
public List<System.Linq.IQueryable<ArticleComment>> Comments
{
get
{
if (_Comments == null)
_Comments = new List<IQueryable<ArticleComment>>();
return _Comments;
}
set
{
_Comments = value;
}
}
}
I get a collection of articles using this snippet
var list = new IMBDB().Select.From<Article>()
.InnerJoin<ArticleCategory>(ArticlesTable.CategoryIDColumn, ArticleCategoriesTable.IDColumn)
.InnerJoin<ArticleComment>(ArticlesTable.ArticleIDColumn,ArticleCommentsTable.ArticleIDColumn)
.Where(ArticleCategoriesTable.DescriptionColumn).IsEqualTo(category).ExecuteTypedList<Article>();
list.ForEach(x=>x.CategoryName=category);
list.ForEach(y => y.Comments.AddRange(list.Select(z => z.ArticleComments)));
I get the collection Ok but when I try to use the comments collection using
foreach (IMB.Data.Article item in Model)
{
%>
<%
foreach (IMB.Data.ArticleComment comment in item.Comments)
{
%>
***<%=comment.Comment %>***
<%}
} %>
the comment.Comment line throws this exception
Unable to cast object of type 'SubSonic.Linq.Structure.Query`1[IMB.Data.ArticleComment]' to type 'IMB.Data.ArticleComment'.
I am basically trying to avoid hitting the database each time the comment is needed.
is there another to achieve this?
Thanks
OK - I'm not doing exactly what you're attempting but hopefully this example will bring some clarity to the situation. This is more along the lines of how I would do a join using SubSonic if I absolutely had to do it this way. The only way I would consider this approach is if I were confined by some 3rd party implementation of the object and/or database schema...
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using SubSonic.Repository;
namespace SubsonicOneToManyRelationshipChildObjects
{
public static class Program
{
private static readonly SimpleRepository Repository;
static Program()
{
try
{
Repository = new SimpleRepository("SubsonicOneToManyRelationshipChildObjects.Properties.Settings.StackOverflow", SimpleRepositoryOptions.RunMigrations);
}
catch (Exception ex)
{
Console.WriteLine(ex);
Console.ReadLine();
}
}
public class Article
{
public int Id { get; set; }
public string Name { get; set; }
private ArticleCategory category;
public ArticleCategory Category
{
get { return category ?? (category = Repository.Single<ArticleCategory>(single => single.Id == ArticleCategoryId)); }
}
public int ArticleCategoryId { get; set; }
private List<ArticleComment> comments;
public List<ArticleComment> Comments
{
get { return comments ?? (comments = Repository.Find<ArticleComment>(comment => comment.ArticleId == Id).ToList()); }
}
}
public class ArticleCategory
{
public int Id { get; set; }
public string Name { get; set; }
}
public class ArticleComment
{
public int Id { get; set; }
public string Name { get; set; }
public string Body { get; set; }
public int ArticleId { get; set; }
}
public static void Main(string[] args)
{
try
{
// generate database schema
Repository.Single<ArticleCategory>(entity => entity.Name == "Schema Update");
Repository.Single<ArticleComment>(entity => entity.Name == "Schema Update");
Repository.Single<Article>(entity => entity.Name == "Schema Update");
var category1 = new ArticleCategory { Name = "ArticleCategory 1"};
var category2 = new ArticleCategory { Name = "ArticleCategory 2"};
var category3 = new ArticleCategory { Name = "ArticleCategory 3"};
// clear/populate the database
Repository.DeleteMany((ArticleCategory entity) => true);
var cat1Id = Convert.ToInt32(Repository.Add(category1));
var cat2Id = Convert.ToInt32(Repository.Add(category2));
var cat3Id = Convert.ToInt32(Repository.Add(category3));
Repository.DeleteMany((Article entity) => true);
var article1 = new Article { Name = "Article 1", ArticleCategoryId = cat1Id };
var article2 = new Article { Name = "Article 2", ArticleCategoryId = cat2Id };
var article3 = new Article { Name = "Article 3", ArticleCategoryId = cat3Id };
var art1Id = Convert.ToInt32(Repository.Add(article1));
var art2Id = Convert.ToInt32(Repository.Add(article2));
var art3Id = Convert.ToInt32(Repository.Add(article3));
Repository.DeleteMany((ArticleComment entity) => true);
var comment1 = new ArticleComment { Body = "This is comment 1", Name = "Comment1", ArticleId = art1Id };
var comment2 = new ArticleComment { Body = "This is comment 2", Name = "Comment2", ArticleId = art1Id };
var comment3 = new ArticleComment { Body = "This is comment 3", Name = "Comment3", ArticleId = art1Id };
var comment4 = new ArticleComment { Body = "This is comment 4", Name = "Comment4", ArticleId = art2Id };
var comment5 = new ArticleComment { Body = "This is comment 5", Name = "Comment5", ArticleId = art2Id };
var comment6 = new ArticleComment { Body = "This is comment 6", Name = "Comment6", ArticleId = art2Id };
var comment7 = new ArticleComment { Body = "This is comment 7", Name = "Comment7", ArticleId = art3Id };
var comment8 = new ArticleComment { Body = "This is comment 8", Name = "Comment8", ArticleId = art3Id };
var comment9 = new ArticleComment { Body = "This is comment 9", Name = "Comment9", ArticleId = art3Id };
Repository.Add(comment1);
Repository.Add(comment2);
Repository.Add(comment3);
Repository.Add(comment4);
Repository.Add(comment5);
Repository.Add(comment6);
Repository.Add(comment7);
Repository.Add(comment8);
Repository.Add(comment9);
// verify the database generation
Debug.Assert(Repository.All<Article>().Count() == 3);
Debug.Assert(Repository.All<ArticleCategory>().Count() == 3);
Debug.Assert(Repository.All<ArticleComment>().Count() == 9);
// fetch a master list of articles from the database
var articles =
(from article in Repository.All<Article>()
join category in Repository.All<ArticleCategory>()
on article.ArticleCategoryId equals category.Id
join comment in Repository.All<ArticleComment>()
on article.Id equals comment.ArticleId
select article)
.Distinct()
.ToList();
foreach (var article in articles)
{
Console.WriteLine(article.Name + " ID " + article.Id);
Console.WriteLine("\t" + article.Category.Name + " ID " + article.Category.Id);
foreach (var articleComment in article.Comments)
{
Console.WriteLine("\t\t" + articleComment.Name + " ID " + articleComment.Id);
Console.WriteLine("\t\t\t" + articleComment.Body);
}
}
// OUTPUT (ID will vary as autoincrement SQL index
//Article 1 ID 28
// ArticleCategory 1 ID 41
// Comment1 ID 100
// This is comment 1
// Comment2 ID 101
// This is comment 2
// Comment3 ID 102
// This is comment 3
//Article 2 ID 29
// ArticleCategory 2 ID 42
// Comment4 ID 103
// This is comment 4
// Comment5 ID 104
// This is comment 5
// Comment6 ID 105
// This is comment 6
//Article 3 ID 30
// ArticleCategory 3 ID 43
// Comment7 ID 106
// This is comment 7
// Comment8 ID 107
// This is comment 8
// Comment9 ID 108
// This is comment 9
Console.ReadLine();
// BETTER WAY (imho)...(joins aren't needed thus freeing up SQL overhead)
// fetch a master list of articles from the database
articles = Repository.All<Article>().ToList();
foreach (var article in articles)
{
Console.WriteLine(article.Name + " ID " + article.Id);
Console.WriteLine("\t" + article.Category.Name + " ID " + article.Category.Id);
foreach (var articleComment in article.Comments)
{
Console.WriteLine("\t\t" + articleComment.Name + " ID " + articleComment.Id);
Console.WriteLine("\t\t\t" + articleComment.Body);
}
}
Console.ReadLine();
// OUTPUT should be identicle
}
catch (Exception ex)
{
Console.WriteLine(ex);
Console.ReadLine();
}
}
}
}
The following is my personal opinion and conjecture and can be tossed/used as you see fit...
If you look at the "Better way" example this is more along the lines of how I actually use SubSonic.
SubSonic is based on some simple principles such as
Each table is an object (class)
Each object instance has an Id (e.g. Article.Id)
Each object should have a Name (or similar)
Now if you write your data entities (your classes that are representations of your tables) in a manner that makes sense when you use SubSonic you're going to work well together as a team. I don't really do any joins when I work with SubSonic because I typically don't need to and I don't want the overhead. You start to show a good practice of "lazy-loading" the comment list property on your article object. This is good, this means if we need the comments in the consumer code, go get-em. If we don't need the comments, don't spend the time & money to go fetch them from the database. I restructured your ArticleCategory to Article relationship in a way that makes sense to me but may not suit your needs. It seemed like you agreed with Rob conceptually (and I agree with him again).
Now, there are 1000 other improvements to be made to this architecture. The first that comes to mind is to implement a decent caching pattern. For example, you may not want to fetch the comments from the database on each article, every time the article is loaded. So you might want to cache the article and comments and if a comment is added, in your "add comment" code, wipe the article from the cache so it gets rebuild next load. Categories is a perfect example of this... I would typically load something like categories (something that isn't likely to change every 5 minutes) into a master Dictionary (int being the category id) and just reference that in-memory list from my Article code. These are just basic ideas and the concept of caching, relational mapping database or otherwise can get as complicated as you like. I just personally try to adhere to the SubSonic mentality that makes database generation and manipulation so much easier.
Note: If you take a look at the way Linq2SQL does things this approach is very similar at the most basic layer. Linq2SQL typically loads your dependent relationships every time whether you wanted that or knew it was doing it or not. I much prefer the SubSonic "obviousness", if you will, of what is actually happening.
Sorry for the rant but I really hope you can run the above code in a little Console application and get a feel for what I'm getting at.
first thought, shouldn't the category association be the other way around? Category has many Articles? I don't know if that will help here - it's my first observation.
I think you're having a naming collision here. A "Structure.Query" is an object we create on the Structs.tt and it looks like that's the namespace you're referencing somehow with "item.Comments". My guess is there's a table somewhere called "Comments" that is getting confused.
Can you open up the Article class and look at the return of "Comments" property to make sure it's returning a type, and not the query?

Categories

Resources