using System;
namespace Aspire.SKM {
public class SkmSession {
static void Main(string[] args)
{
if (1 == 1)
{
Console.WriteLine("Hello World!");
}
}
}
}
public class Hello {
public static void main(String[] args) {
if (1 == 1) {
System.out.print("Hello World");
}
}
}
using System;
namespace Aspire.SKM {
public class SkmSession {
static void Main(string[] args)
{
if (1 == 1)
{
Console.WriteLine("Hello World!");
}
}
}
}
public class Hello {
public static void main(String[] args) {
if (1 == 1) {
System.out.print("Hello World");
}
}
}
C# (pronounced see sharp, like the musical note C♯, but written with the number sign)[b] is a general-purpose, multi-paradigm programming language encompassing strong typing, lexically scoped, imperative, declarative, functional, generic, object-oriented (class-based), and component-oriented programming disciplines.
(...) object-oriented (class-based), and component-oriented (...)
package com.journaldev.java.legacy;
public class MyApplication {
private EmailService emailService;
public MyApplication(EmailService emailService) {
this.emailService = emailService;
}
public void processMessages(String msg, String rec){
this.email.sendEmail(msg, rec);
}
}
Why no interface?
EmailService
IEmailService
Composition vs Inheritance
How about functional programming?
+ MVC
Manager paczek (zamiast Mavena czy CocoaPods)
CORE
API + MVC
// PUT: api/TodoItems/5
[HttpPut("{id}")]
public async Task<IActionResult> PutTodoItem(long id, TodoItem todoItem)
{
if (id != todoItem.Id)
{
return BadRequest();
}
_context.Entry(todoItem).State = EntityState.Modified;
try
{
await _context.SaveChangesAsync();
}
catch (DbUpdateConcurrencyException)
{
if (!TodoItemExists(id))
{
return NotFound();
}
else
{
throw;
}
}
return NoContent();
}
@page "/counter"
<h1>Counter</h1>
<p>Current count: @currentCount</p>
<button class="btn btn-primary" @onclick="IncrementCount">Click me</button>
@code {
private int currentCount = 0;
[Parameter]
public int IncrementAmount { get; set; } = 1;
private void IncrementCount()
{
currentCount += IncrementAmount;
}
}
or
Autoreklama - API w ASP.NET Core
Zapraszam na Slacka - pomogę, wytłumaczę, wyjaśnię :)
Miłego kodzenia :)
Zdrowych, wesołych świąt :)