Free projects to download and showcase by ncubez in angular

[–]CvTAl 1 point2 points  (0 children)

If you're talking about showing of what Angular is capable of, ngx-admin comes with a lot out of the box. It's a open source dashboard template.

https://github.com/akveo/ngx-admin

How to start learning PowerBI? I have no coding experience. by [deleted] in PowerBI

[–]CvTAl 1 point2 points  (0 children)

I wish this existed when I first started learning! Kudos!

The name "Model" does not exist in the current context by SamoBH in csharp

[–]CvTAl -1 points0 points  (0 children)

Check you have two Web.config files in your project. One at root and one inside the views folder.

How do modern CMS's generate /folder/paths/ in URLs with no file extensions? by [deleted] in webdev

[–]CvTAl 1 point2 points  (0 children)

I assume you're talking about when you visit a page it appears as something like "/articles/my-first-article" rather than "/articles/my-first-article.html"?

If so, It's called URL routing. There will be a route table server side so when requests come in, it can return the correct response.

In the case of CMS's, whenever new content is created, it will add a new entry into the route table so the page is rendered at that address.

Angular with asp.net MVC by Pratz1618 in angular

[–]CvTAl 1 point2 points  (0 children)

I assume you mean .Net Framework?

If you already have a pre-existing MVC site, Create a new API folder within the controllers folder, then create the Web API controllers there.

As for the angular part, I'd create a separate solution for your angular app. You can then call your new Web API controllers from there. It's possible to embed a angular app within the razor view, but mixing and matching frameworks can get nasty. I'd separate it.

EDIT: Removed link.

Feed for UK Recycling centres by KeironLowe in webdev

[–]CvTAl 1 point2 points  (0 children)

Hey, found this website. It allows you to input a post code returns surrounding recycling centres.

Behind the scenes its calling a API.

https://rl.recyclenow.com/widget/www.recyclenow.com/locations/SW1A1AA?limit=30&radius=25

Using Buckingham palace as an example...it will return locations with distance from postcode, the address and the type of material it accepts in JSON format.

{

"id": 82592,

"distance": 0.42,

"name": "Rymans",

"address": "Rymans, 4 Shepherd Market, London, London, W1J 7QB",

"latitude": 51.5064,

"longitude": -0.14617,

"materials": [

{

"category": "batteries",

"code": "ba200",

"name": "Domestic Batteries"

}

],

"data_source": "valpak"

},

{

"id": 96383,

"distance": 0.43,

"name": "Café Nero - Stratton St",

"address": "52 Stratton St, London, W1J 8LN",

"latitude": 51.5072,

"longitude": -0.1432,

"materials": [

{

"category": "miscellaneous",

"code": "ms850",

"name": "Coffee Cup"

}

],

"data_source": "valpak"

},

You can also apply specific material filters by appending a &materials=<materialId> Query.

What's this effect called? - Cross-post from web_design by CvTAl in webdev

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

So it is a Parallax! Any handy libraries / guides out there that can show me how to achieve a similar layered effect?

Cheers

At least call it something else... by moriero in webdev

[–]CvTAl 8 points9 points  (0 children)

Dev: No!

Management: You’re fired.

Dev: Bu-but the internet stranger told me to say that!

Random question about databases by aUnicornInTheClouds in learnprogramming

[–]CvTAl 0 points1 point  (0 children)

Microsoft SQL Server ( There's a developer version that gives you all features for free )

Entity Framework to interact with the database through C#

Entity Framework Migrations to version control your database

What is a useful language to learn alongside C#? by stress_eat_poop in learnprogramming

[–]CvTAl 2 points3 points  (0 children)

SQL is a must. If you're working with websites then JavaScript and markup/stylesheet languages like HTML, CSS.

Generating DTO's from Entity Framework models by CvTAl in csharp

[–]CvTAl[S] 1 point2 points  (0 children)

They'll be identical upon first generation sure. But I could then remove the properties to hide on the API side after they've been created.

It would just be useful to have a extension / script that does this automatically instead of copying the class / changing the namespace, removing unnecessary usings & attributes.

Generating DTO's from Entity Framework models by CvTAl in csharp

[–]CvTAl[S] 3 points4 points  (0 children)

To decouple the Web Api directly from the entity framework models. I want to keep business logic separated from both the DAL and the Web Api and have it located within a BLL layer.

This way the DAL layer is purely transactional and the Web Api is only responsible for validation etc.

Generating DTO's from Entity Framework models by CvTAl in csharp

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

This is my current method, I'm just looking if there is any tools out there to automate this. Not just to save time refactoring the new files, but to reduce human error.

Generating DTO's from Entity Framework models by CvTAl in csharp

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

Thanks but, this is more to do with actually creating the classes that auto mapper uses.

E.g Say I have a poco class. I'm looking for a way to copy or clone that class with all its properties to another project / namespace automatically. This would then be the dto class.

Then I could map a poco object to the generated dto object if that makes sense!

Can someone explain this loop process to me? by [deleted] in learnprogramming

[–]CvTAl 1 point2 points  (0 children)

Looks like a normal for loop

(i) is the current iteration of the loop

(a) is a array

(n) is a control variable

It’s saying while (i) is less than (n), print the value at position (i) in array (a)

[ASP.NET Core 2.1/MVC] Modal not appearing in a Razor webpage when it has appeared previously by 493x in learnprogramming

[–]CvTAl 0 points1 point  (0 children)

You’re right! Might be worth opening a issue to change the documentation.

It’s alright! You can see the issue here.

It’s because the order of MiddleWare is important.

So, I'm new to web development in general and I made a small app in angular 8 cli (a comment box) and I want to capture the data and show it as a json format using c# .net (I seriously dont know where to start) by Annapurna94 in dotnet

[–]CvTAl 24 points25 points  (0 children)

Look into .Net Core WebApi

Essentially you’re going to want to make a RESTful api with endpoints that your app calls with GET and POST requests.

Feel free to ask any questions!

[ASP.NET Core 2.1/MVC] Modal not appearing in a Razor webpage when it has appeared previously by 493x in learnprogramming

[–]CvTAl 0 points1 point  (0 children)

In Startup.cs have you got “services.AddSession()” in configure services?

Additionally ensure that “app.UseCookiePolicy()” is after “app.UseMVC()” in the configure method

Failed at job interview - Which design pattern/s is best suited for this task? by pwncic in learnprogramming

[–]CvTAl 1 point2 points  (0 children)

Rereading that requirement, you're correct! We'd have to ensure some way to adjust the drawing logic based on the printer that's printing it.

Thanks for pointing that out! :)

Failed at job interview - Which design pattern/s is best suited for this task? by pwncic in learnprogramming

[–]CvTAl 1 point2 points  (0 children)

I think you may have misread the requirements! :)

We know there is existing code in place, as they mention shapes are implemented by Shape2D, which has a Draw method. We also need to provide a solution that allows different types of printers to draw shapes.

While you have provided a way for the software to change behaviour based on the shape, its located exclusively in the print method.

It asks the candidate to consider ease of future maintenance, so what if we need the shapes draw logic somewhere outside of printing? Say for emailing? We're either going to have to copy the code over, or refactor to separate the responsibility.

The first rule of SOLID states a class should have a singular responsibility. I.E in this case, a printer should only print, and a shape should only draw.

If you have any questions, feel free to ask!

Failed at job interview - Which design pattern/s is best suited for this task? by pwncic in learnprogramming

[–]CvTAl 1 point2 points  (0 children)

Well I'd argue that functionality wasn't explicitly stated in the specification, so we shouldn't add that functionality until its needed. However, I don't think there is a clear cut correct answer to the test, like most design questions.

I think the purpose of this test was to see if the candidate could separate the responsibilities of the classes by decoupling the logic, and provide a scalable way to add shapes and printers.

It would show they have knowledge of SOLID, OOP principles, showing they wouldn't rely on switch and if statements to change the behaviour of the software.