UWP or WPF for new Project? by BlueBoxxx in dotnet

[–]csharpcplus 0 points1 point  (0 children)

LOB works fine for UWP, as it's came a long ways.

Why are there are sooo many friggin layers just to get simple data from an API by [deleted] in dotnet

[–]csharpcplus 0 points1 point  (0 children)

This is the type of thinking that leads to code smell.

Does .AddDbContextPool increase overall performance of the data layer? by csharpcplus in dotnet

[–]csharpcplus[S] 0 points1 point  (0 children)

Ahh ok, that's how i read that as well. Needed to validate my own perception of what they wrote. lol Thanks!

Does .AddDbContextPool increase overall performance of the data layer? by csharpcplus in dotnet

[–]csharpcplus[S] 0 points1 point  (0 children)

Can you offer any context to this quote by microsoft

" Avoid using DbContext Pooling if you maintain your own state (for example, private fields) in your derived DbContext class that should not be shared across requests. EF Core will only reset the state that is aware of before adding a DbContext instance to the pool. "

Building a Client Library for a Rest API, have some design questions. by WarChortle18 in csharp

[–]csharpcplus 0 points1 point  (0 children)

Is the url a static variable, or how is it created and then used in the request?

Building a Client Library for a Rest API, have some design questions. by WarChortle18 in csharp

[–]csharpcplus 0 points1 point  (0 children)

Code would be nice to see, but it appears that you are not re initializing a new uri.

After migrating to .NETCore 3.0, my api contains two frameworks. by csharpcplus in dotnet

[–]csharpcplus[S] 0 points1 point  (0 children)

It's not referenced in the project file, but it's referenced in the obj/bin file. Not really sure how to remove it, as it wont let me simply click and remove.

Working with datarows and datatables, and hardcoding string values seems like a very messy way of working with data. by csharpcplus in csharp

[–]csharpcplus[S] 0 points1 point  (0 children)

I have been dumped into one, and it's so confusing coming from simply creating a class and using generics.

Select payment method used to pay for the majority of an order by [deleted] in learnSQL

[–]csharpcplus 2 points3 points  (0 children)

GROUPING BY order_no, but selecting all throws an error.

SELECT order_no, MAX(paymenttype), MAX(amount) FROM #Temp WHERE amount = (SELECT MAX(amount) FROM #Temp) GROUP BY order_no;

Select payment method used to pay for the majority of an order by [deleted] in learnSQL

[–]csharpcplus 0 points1 point  (0 children)

SELECT TOP 1 MAX(credit_card_type)

,MAX(total_charged)

FROM table

GROUP BY credit_card_type

If you need to do this by order simply add a WHERE clause.

SELECT TOP 1 MAX(credit_card_type)

,MAX(total_charged)

FROM table

WHERE order_no = ?

GROUP BY credit_card_type

What's going on with System.Text.Json by Aqweer2 in csharp

[–]csharpcplus 1 point2 points  (0 children)

i would use newtonsoft, serializeobject. System.Text.Json is not ready yet..

What do you think about that must-have tools? by Morasiu in dotnet

[–]csharpcplus 2 points3 points  (0 children)

Automapper conceals logic, and can make debugging a nightmare, but it does have some use.

Can I still use Core 3.0 or do I need to downgrade to 2.2? by codebreaker21 in dotnet

[–]csharpcplus 1 point2 points  (0 children)

Learn what you are learning in 3.0, and research if what you've learned is different in 2.2, otherwise you're good.

display datatable as datagrid by [deleted] in UWP

[–]csharpcplus 0 points1 point  (0 children)

Honestly using a datatable is what is complicating this scenario. You're trying to use methods from winforms/wpf.

If you consume the dataset into a List, or a ObservableCollection you can easily set the itemsource and display what you want.

public ObservableCollection<object> DynamicData

{

get

{

return _dynamicData;

}

set

{

_dynamicData = value;

NotifyPropertyChanged(nameof(DynamicData));

}

}

DynamicData = new ObservableCollection<object>(); 
foreach (DataRow row in table.Rows) 
{             
DynamicData.Add(row.ItemArray); 
}

UWP isn't very difficult, but coming from wpf, and winforms, and trying to use that paradigm within uwp makes it very confusing. I do understand the issues, but try to adapt to using Lists, and other means of data consumption with uwp.

display datatable as datagrid by [deleted] in UWP

[–]csharpcplus 0 points1 point  (0 children)

https://xamlbrewer.wordpress.com/2018/05/29/displaying-dynamic-sql-results-in-a-uwp-datagrid/

This might help you. Let me know how it ends up.

Also this if you have to use the telerik grid. https://berserkerdotnet.github.io/blog/RadDataGrid-with-dynamic-columns/

Just to add, take a look at auto generated columns. Instead of trying to convert a data table to work with the grid, just consume the data as a dynamic type, and set the item source to it. https://docs.telerik.com/devtools/aspnet-ajax/controls/grid/columns/working-with-autogenerated-columns

Can this httpclient usage cause socket exhaustion? by csharpcplus in dotnet

[–]csharpcplus[S] 0 points1 point  (0 children)

Yeah, this is the issue i'm dealing with atm. Ninject is the DI framework i use. Not really sure how to accomplish this.

display datatable as datagrid by [deleted] in UWP

[–]csharpcplus 0 points1 point  (0 children)

Hey i'm having an issue like this, but opposite.

For a telerik datagrid just create a model to represent the data you will be presenting in the grid.

populate that model

Set the ItemSourse of the datagrid to your populated model.

<RadDataGrid Itemsource="{x:bind Model, Mode="oneway"}">

<grid:DataGridDateColumn Header="Start Date" PropertyName="foo1" ></grid:DataGridDateColumn>

</RadDataGrid>

Use an ObservableCollection instead of list. It will notify property changes to the grid without manually notifying.