Skip to content

Instantly share code, notes, and snippets.

@srinionline
srinionline / WeatherForecastController.cs
Created January 12, 2023 09:55
Techstrology-How to create Insert (Post)
using System.Collections.Generic;
using API_IN_COMPARE.Interface;
using API_IN_COMPARE.Model;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
namespace API_IN_COMPARE.Controllers
{
[ApiController]
[Route("[controller]")]
@srinionline
srinionline / CategoryRepository.cs
Created January 12, 2023 09:52
Techstrology-How to create Insert (Post)
using API_IN_COMPARE.Data;
using API_IN_COMPARE.Interface;
using API_IN_COMPARE.Model;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace API_IN_COMPARE.SqlRepo
@srinionline
srinionline / communicationStatusReducer.js
Created January 11, 2023 17:22
Techstrology- The slice reducer for key
const defaultStatus = {
"READY": "True"
}
const communicationStatusReducer = (state = defaultStatus, { type }) => {
debugger
switch (type) {
case 'CRETAE_NEW_MESSAGE':
return "WAITING";
case "NEW_MESSAGE_SERVER_ACCEPTED":
@srinionline
srinionline / UndefinedState.js
Created January 11, 2023 17:20
Techstrology- The slice reducer for key
const communicationStatusReducer = (state = {}, { type }) => {
debugger
switch (type) {
case 'CRETAE_NEW_MESSAGE':
return "WAITING";
case "NEW_MESSAGE_SERVER_ACCEPTED":
return "READY"
}
return state
}
@srinionline
srinionline / CreateStore.js
Last active January 11, 2023 17:17
Techstrology- The slice reducer for key
const apiCommunicationStatusReducer = (state , { type }) => {
debugger
switch (type) {
case 'CRETAE_NEW_MESSAGE':
return "WAITING";
case "NEW_MESSAGE_SERVER_ACCEPTED":
return "READY"
}
}
@srinionline
srinionline / UpdateAction2.js
Created January 11, 2023 17:06
Techstrology-Actions must be plain objects
const statusUpdateAction = (value) => {
return {
type: 'UPDATE_STATUS',
value
}
}
document.forms.selectStatus.status.addEventListener("change", (e) => {
store.dispatch(statusUpdateAction()); // <= () Here was what I've missed.
});
@srinionline
srinionline / UpdateAction.js
Created January 11, 2023 17:04
Techstrology-Actions must be plain objects
const statusUpdateAction = (value) => {
return {
type: 'UPDATE_STATUS',
value
}
}
document.forms.selectStatus.status.addEventListener("change", (e) => {
store.dispatch(statusUpdateAction);
});
@srinionline
srinionline / CodeWishper3.js
Created January 11, 2023 16:55
Techstrology-Warning: Received
import React from "react";
const CodeWishper = ({value}) => {
return (
<form className="form-inline" name="newMessage">
<fieldset name="fields">
<input type="text" className="form-control" name="newMessage" placeholder="Type a new message" />
<button type="submit" name={value ? 1 : 0} className="btn btn-primary">Say something</button>
</fieldset>
</form>
)}
@srinionline
srinionline / CodeWishper2.js
Created January 11, 2023 16:52
Techstrology-Warning: Received
import React from "react";
const CodeWishper = () => {
return (
<form className="form-inline" name="newMessage">
<fieldset name="fields">
<input type="text" className="form-control" name="newMessage" placeholder="Type a new message" />
<button type="submit" className="btn btn-primary">Say something</button>
</fieldset>
</form>
)}
@srinionline
srinionline / CodeWishper.js
Created January 11, 2023 16:45
Techstrology-Warning: Received
import React from "react";
const CodeWishper = () => {
return (
<form className="form-inline" name="newMessage">
<fieldset name="fields">
<input type="text" className="form-control" name="newMessage" placeholder="Type a new message" />
<button type="submit" name className="btn btn-primary">Say something</button>
</fieldset>
</form>
)}