@Squirrel.98 Good Job! Now just don't get it again
@AndyD273 Ya I see what you're looking to do, It looks like a stander-ish api for requests, with an IP or Host Middleware to filter where requests are authorized instead of a login.
I am reading excel file with ClosedXML,
I have data in 1 single Column A1.A2.A3... all A columns,
When I open excel and delete A2.A3 and keep only single value in A1 and save excel,
after that when I upload file to file control it uploads file and prints 3 even though I have single data in A1.
it...
Error CS0266 Cannot implicitly convert type 'System.Collections.Generic.List<AssetDeclaration.Infrastructure.Models.AssetDeclarationSummary>' to 'System.Collections.Generic.ICollection<AssetDeclaration.Domain.Interfaces.IAdditionalAssetSummary>'. An explicit conversion exists (are you missing a cast?)
i created interface in namespace AssetDeclaration.Domain.Interfaces
and classes in namespace AssetDeclaration.Infrastructure.Models
I am trying to implement my function as below
public ICollection<IAdditionalAssetSummary> GetAdditionalAssetSummary() { var summary=(from a in _context.AssetDeclarationAdditionalAssets join at in _context.AssetTypes on a.AssetTypeId equals at.Id group new { at.Name, a.CreatedBy } by at.Name into g select new AssetDeclarationSummary { AssetType = g.Key, EmployeeCount = g.Select(x=>x.CreatedBy).Distinct().Count()
the issue is that a List<String> is not a valid ICollection<Object>
(where String is just a subtype of Object, any 2 types in a hierarchy where A is a subtype of B would have this problem)
because a collection of objects claims that you can add more objects to it, but a list of strings does not allow that
you would have to return a list of the supertype
List<IAddicionalAssetSummary> in your case
basically, before you do ToList(), also do a Cast<IAdditionalAssetSummary>()
also 2 hints: 1, avoid var unless it is extremely obvious which type it is (literals or in combination with new) 2, avoid sql syntax linq queries, just use the method syntax
@gorgeusDev dont use array, use List, dont add items when the value is an empty string, if necessary, you could convert the list to an array afterwards
@Squirrelkiller in our codebase, we dont even see the dead code, we are too used to it
@Ravi generic parameters are usually not covariant, unless it's na interface and marked as out T. A simple fix here would be return summary.Cast<IAdditionalAssetSummary>();.
@Squirrel.98 Definitely string.IsNullOr... but don't ask Wietlol.
string is the C# language keyword, compiler will turn it to `String`. Similar to int -> `Int32`. String is the actual class, compiler has no choice. MS says to use the language keyword whenever possible.
string is an alias in C# for System.String.
So technically, there is no difference. It's like int vs. System.Int32.
As far as guidelines, it's generally recommended to use string any time you're referring to an object.
e.g.
string place = "world";
Likewise, I think it's generally recommended to...
These are the steps I did to make it work.
Tools > NuGet Package Manager > Package Manager Settings
Go into Package Sources
Copy the details of nuget.org
Delete nuget.org
Then, re-add nuget.org using the details you copied.
Not sure why this has worked for me..
I am quite amazed, considering it had the same details. Unless, the source had some corruption.
depends on the ordering how you published the versions
if both minor features goes without version release, then you publish it, it will be 1.1.0 including both minor features. If bug fixes first, then minor feature it's still 1.1.0
@Squirrel.98 more like happy sometimes, sulking sometimes, so desperate for companionship that I'm getting myself in trouble, even though I have a history of being just as emotionally erratic when I am in a relatoinship anwyay
having more friends irl would be really helpful, too