DisplayMeasurement(-4); // Output: Measured value is -4; out of an acceptable range. DisplayMeasurement(50); // Output: Measured value is 50. DisplayMeasurement(132); // Output: Measured value is 132; out of an acceptable range. void DisplayMeasurement(int measurement) { switch (measurement) { case 100: Console.WriteLine($"Measured value is {measurement}; out of an acceptable range."..
Controller.View Method VS Controller.RedirectToAction Method View() 와 RedirectToAction() 메소드 모두 화면을 전환 한다는 기능적 측면에서는 동일한다. 하지만 View()는 동일한 Controller 내에서만 화면 전환이 가능하고 RedirectToAction()는 Controller와 상관없이 화면 전환이 가능한다. 측 동일한 Controller 에서의 화면 전환 이라면 View()를 사용하고 그렇치 않다면 RedirectToAction()를 사용하면 된다.
enum Season { Spring, Summer, Autumn, Winter } enum ErrorCode : ushort { None = 0, Unknown = 1, ConnectionLost = 100, OutlierReading = 200 } enum 과 switch 문 활용 예) public enum WhiteIpRequestState { NoRequest = 0, Requested = 1, Approved = 2, Rejected = 3 } WhiteIpRequestState whiteIpRequestState = ... switch(whiteIpRequestState) { case WhiteIpRequestState.NoRequest: case WhiteIpRequestState.Rejec..
📌ViewBag Gets the dynamic view data dictionary. Property Value Object The dynamic view data dictionary. // in Controller public ActionResult Index() { List colors = new List(); colors.Add("red"); colors.Add("green"); colors.Add("blue"); ViewBag.ListColors = colors; //colors is List ViewBag.DateNow = DateTime.Now; ViewBag.Name = "Hajan"; ViewBag.Age = 25; return View(); } // in View 📌ViewData Get..
IActionFilter ? action의 실행과 관련된 필터입니다. OnActionExcuted ? "action"을 실행한 후 "action" 결과 전에 호출됩니다. OnActionExcuting ? 모델 바인딩이 완료된 후 "action"이 실행되기 전에 호출됩니다. 활용 1) public class ActionFilter : ActionFilterAttribute { public override void OnActionExecuting(ActionExecutingContext filterContext) { // 로그인 여부 체크 및 권한 체크와 같은 다양한 로직을 적용 할 수 있다. // filterContext.Result = new RedirectResult(Url); var controlle..
List names = new List() { "John", "Anna", "Monica" }; var result = String.Join(", ", names.ToArray()); var combined = String.Join(",", new String[]{"a","b"}); // a,b List names = new List() { "John", "Anna", "Monica" }; var result = String.Join(", ", names.ToArray()); using System.Linq string.Join(",", people.Select(x => x.surname))
- Total
- Today
- Yesterday
- await
- 아이폰
- system.io
- In App Purchase
- async
- 상품 등록
- Task
- nl2br
- 진수 변환
- App Store
- 명령어
- System.Diagnostics
- MainActor
- 앱 스토어
- .submit()
- trim
- FileUpload
- 문자 자르기
- 제품 등록
- mssql
- 공백제거
- html tag
- hyper-v
- 특정 문자를 기준으로 자르기
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |